Commit f6d28cf0 authored by Jeff Downs's avatar Jeff Downs

parse_options(): Avoid passing NULL as a string arg to fprintf

parent f925b243
...@@ -281,7 +281,7 @@ unknown_opt: ...@@ -281,7 +281,7 @@ unknown_opt:
*po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY); *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY);
} else if (po->u.func_arg) { } else if (po->u.func_arg) {
if (po->u.func_arg(opt, arg) < 0) { 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); exit(1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment