From 1fa7dec70246aaa6e693baa3598e6cf8f46669ca Mon Sep 17 00:00:00 2001 From: Cyril Hrubis Date: Thu, 11 Apr 2013 16:55:14 +0200 Subject: [PATCH] spiv: Exit if no images were passed. Signed-off-by: Cyril Hrubis --- demos/spiv/spiv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c index 5a92232a..fcb7ed58 100644 --- a/demos/spiv/spiv.c +++ b/demos/spiv/spiv.c @@ -833,7 +833,13 @@ int main(int argc, char *argv[]) return 1; } } - + + if (optind >= argc) { + fprintf(stderr, "Requires path to at least one image\n\n"); + print_help(); + return 1; + } + GP_SetDebugLevel(debug_level); signal(SIGINT, sighandler); -- 2.11.4.GIT