From f7fff0096a69e64c5b87bf968abf5b48b8037547 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 7 Sep 2012 11:42:34 +0200 Subject: [PATCH] getopt: make the code more readable for analysers Signed-off-by: Karel Zak --- misc-utils/getopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c index 0efe5d862a..8de469b1b2 100644 --- a/misc-utils/getopt.c +++ b/misc-utils/getopt.c @@ -251,7 +251,7 @@ static void add_longopt(const char *name, int has_arg) long_options[long_options_nr].flag = NULL; long_options[long_options_nr].val = 0; - if (long_options_nr) { + if (long_options_nr && name) { /* Not for init! */ long_options[long_options_nr - 1].has_arg = has_arg; long_options[long_options_nr - 1].flag = NULL; -- 2.47.3