summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-08 19:32:04 +0000
committerDavid Robillard <d@drobilla.net>2012-03-08 19:32:04 +0000
commit99082336abd05045e4f224fc2d07776648fbcc46 (patch)
tree1bd0a36732e925b46f0ed11617fb5de96c96bd57
parent0046d61833ae1f6a7d5d4bff836d20ddbf571df9 (diff)
downloadsord-99082336abd05045e4f224fc2d07776648fbcc46.tar.gz
sord-99082336abd05045e4f224fc2d07776648fbcc46.tar.bz2
sord-99082336abd05045e4f224fc2d07776648fbcc46.zip
Fix null test case.
git-svn-id: http://svn.drobilla.net/sord/trunk@203 3d64ff67-21c5-427c-a301-fe4f08042e5a
-rw-r--r--src/sordi.c11
1 files changed, 4 insertions, 7 deletions
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;
}