From: Karel Zak Date: Fri, 7 Sep 2012 09:42:34 +0000 (+0200) Subject: getopt: make the code more readable for analysers X-Git-Tag: v2.23-rc1~717 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7fff0096a69e64c5b87bf968abf5b48b8037547;p=thirdparty%2Futil-linux.git getopt: make the code more readable for analysers Signed-off-by: Karel Zak --- 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;