]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
getopt: fix normalize() usage [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 27 Mar 2013 13:38:07 +0000 (14:38 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 27 Mar 2013 13:38:07 +0000 (14:38 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/getopt.c

index a597800429138b6b3e205a9e65d53b2ce716ee47..55a331f442312c63c840310212d3d75fe7c4a712 100644 (file)
@@ -190,7 +190,7 @@ static int generate_output(char *argv[], int argc, const char *optstr,
                                if (longopts[longindex].has_arg)
                                        printf(" %s", normalize(optarg ? optarg : ""));
                        } else if (opt == NON_OPT)
-                               printf(" %s", normalize(optarg));
+                               printf(" %s", normalize(optarg ? optarg : ""));
                        else {
                                printf(" -%c", opt);
                                charptr = strchr(optstr, opt);