summaryrefslogtreecommitdiffstats
path: root/misc-utils/getopt.c
diff options
context:
space:
mode:
authorKarel Zak2013-03-27 14:38:07 +0100
committerKarel Zak2013-03-27 14:38:07 +0100
commit31bfda07a4d00ff1b011aff3ad84112adfc0250f (patch)
treef9dc2c537b05a923bc6b60bdecd8a557b6606d57 /misc-utils/getopt.c
parentsu: make code more robust [coverity scan] (diff)
downloadkernel-qcow2-util-linux-31bfda07a4d00ff1b011aff3ad84112adfc0250f.tar.gz
kernel-qcow2-util-linux-31bfda07a4d00ff1b011aff3ad84112adfc0250f.tar.xz
kernel-qcow2-util-linux-31bfda07a4d00ff1b011aff3ad84112adfc0250f.zip
getopt: fix normalize() usage [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/getopt.c')
-rw-r--r--misc-utils/getopt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c
index a59780042..55a331f44 100644
--- a/misc-utils/getopt.c
+++ b/misc-utils/getopt.c
@@ -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);