From 99082336abd05045e4f224fc2d07776648fbcc46 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 8 Mar 2012 19:32:04 +0000 Subject: Fix null test case. git-svn-id: http://svn.drobilla.net/sord/trunk@203 3d64ff67-21c5-427c-a301-fe4f08042e5a --- src/sordi.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/sordi.c b/src/sordi.c index 9654aa4..d06b126 100644 --- a/src/sordi.c +++ b/src/sordi.c @@ -158,12 +158,9 @@ main(int argc, char** argv) SerdEnv* env = serd_env_new(&base_uri_node); SerdReader* reader = sord_new_reader(sord, env, input_syntax, NULL); - bool success = false; - if (from_file) { - success = !serd_reader_read_file_handle(reader, in_fd, in_name); - } else { - success = !serd_reader_read_string(reader, input); - } + const SerdStatus status = (from_file) + ? serd_reader_read_file_handle(reader, in_fd, in_name) + : serd_reader_read_string(reader, input); serd_reader_free(reader); @@ -202,5 +199,5 @@ main(int argc, char** argv) sord_free(sord); sord_world_free(world); - return success ? 0 : 1; + return (status > SERD_FAILURE) ? 1 : 0; } -- cgit v1.2.1