From 2dff746982463158fdf7c3a4a47fee92b1d61551 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 24 May 2011 14:23:24 +0000 Subject: Fix crash when input is not given. CURIEify by default. git-svn-id: http://svn.drobilla.net/serd/trunk@190 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- src/serdi.c | 7 ++++++- wscript | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/serdi.c b/src/serdi.c index 833e92d2..c3f7aa2e 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -138,6 +138,11 @@ main(int argc, char** argv) } } + if (a == argc) { + fprintf(stderr, "Missing input\n"); + return 1; + } + const uint8_t* input = (const uint8_t*)argv[a++]; if (from_file) { in_name = in_name ? in_name : input; @@ -191,7 +196,7 @@ main(int argc, char** argv) if (output_syntax == SERD_NTRIPLES) { output_style |= SERD_STYLE_ASCII; } else { - output_style |= SERD_STYLE_ABBREVIATED; + output_style |= SERD_STYLE_ABBREVIATED|SERD_STYLE_CURIED; } SerdWriter* writer = serd_writer_new( diff --git a/wscript b/wscript index 539836d2..b0a8b897 100644 --- a/wscript +++ b/wscript @@ -222,6 +222,7 @@ def test(ctx): './serdi_static -c > /dev/null', './serdi_static -i illegal > /dev/null', './serdi_static -o illegal > /dev/null', + './serdi_static -i turtle > /dev/null', './serdi_static /no/such/file > /dev/null'], 1, name='serdi-cmd-bad') -- cgit v1.2.1