From 0da475f3e906044371a302df9d6343c4084b31a1 Mon Sep 17 00:00:00 2001 From: katherine Date: Mon, 19 Mar 2018 00:29:15 -0700 Subject: add forgotten NULL check --- src/simple-opt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/simple-opt.h b/src/simple-opt.h index fe714a1..2a3564d 100644 --- a/src/simple-opt.h +++ b/src/simple-opt.h @@ -549,14 +549,14 @@ static void simple_opt_print_usage(FILE *f, unsigned width, char *usage_name, */ /* print "Usage: */ - if (usage_name != NULL) { + if (usage_name != NULL && usage_options != NULL) { fprintf(f, "Usage:"); col = sub_simple_opt_wrap_print(f, width, 6, 7, usage_name); if (usage_options != NULL) - sub_simple_opt_wrap_print(f, width, col, 7 + strlen(usage_name) + 1, - usage_options); + sub_simple_opt_wrap_print(f, width, col, + 7 + strlen(usage_name) + 1, usage_options); fprintf(f, "\n\n"); } -- cgit v1.2.3