diff options
author | Karel Zak | 2012-09-07 11:42:34 +0200 |
---|---|---|
committer | Karel Zak | 2012-09-07 11:42:34 +0200 |
commit | f7fff0096a69e64c5b87bf968abf5b48b8037547 (patch) | |
tree | 91c7bd18e545ebb4698e58ad2846c9a499cb1507 /misc-utils/getopt.c | |
parent | namei: remove dead code [coverity scan] (diff) | |
download | kernel-qcow2-util-linux-f7fff0096a69e64c5b87bf968abf5b48b8037547.tar.gz kernel-qcow2-util-linux-f7fff0096a69e64c5b87bf968abf5b48b8037547.tar.xz kernel-qcow2-util-linux-f7fff0096a69e64c5b87bf968abf5b48b8037547.zip |
getopt: make the code more readable for analysers
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/getopt.c')
-rw-r--r-- | misc-utils/getopt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c index 0efe5d862..8de469b1b 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; |