diff options
author | katherine <shmibs@shmibbles.me> | 2018-03-19 00:29:15 -0700 |
---|---|---|
committer | katherine <shmibs@shmibbles.me> | 2018-03-19 00:29:15 -0700 |
commit | 0da475f3e906044371a302df9d6343c4084b31a1 (patch) | |
tree | 05208804cf8f3824043b3a097d40804590a5b49a | |
parent | ada96265ab15e72f491ba35e05f45583a8a7dedf (diff) | |
download | simple-opt-0da475f3e906044371a302df9d6343c4084b31a1.tar.gz |
add forgotten NULL check
-rw-r--r-- | src/simple-opt.h | 6 |
1 files 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: <exec> <options> */ - 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"); } |