]> granicus.if.org Git - graphviz/commitdiff
Report if argument is missing from -o flag
authorEmden R. Gansner <erg@alum.mit.edu>
Fri, 27 Feb 2015 18:22:49 +0000 (13:22 -0500)
committerEmden R. Gansner <erg@alum.mit.edu>
Fri, 27 Feb 2015 18:22:49 +0000 (13:22 -0500)
lib/common/input.c

index f2fd649fde5be93935a29ed9fabcbc1a59e6fcc1..c79a98e37975117f1e699f18e675983fcc3365aa 100644 (file)
@@ -344,6 +344,10 @@ int dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
                break;
            case 'o':
                val = getFlagOpt(argc, argv, &i);
+               if (!val) {
+                   fprintf(stderr, "Missing argument for -o flag\n");
+                   return (dotneato_usage(1));
+               }
                if (! gvc->common.auto_outfile_names)
                    gvjobs_output_filename(gvc, val);
                break;