parse_options(): Avoid passing NULL as a string arg to fprintf
authorJeff Downs <heydowns@somuchpressure.net>
Thu, 23 Jun 2011 18:12:37 +0000 (14:12 -0400)
committerJeff Downs <heydowns@somuchpressure.net>
Fri, 24 Jun 2011 17:04:51 +0000 (13:04 -0400)
cmdutils.c

index cd6d133..f538d98 100644 (file)
@@ -281,7 +281,7 @@ unknown_opt:
                 *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY);
             } else if (po->u.func_arg) {
                 if (po->u.func_arg(opt, arg) < 0) {
-                    fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
+                    fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg ? arg : "[null]", opt);
                     exit(1);
                 }
             }