summaryrefslogtreecommitdiff
path: root/libdm
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-09-19 20:19:52 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-09-20 14:26:09 +0200
commit548c69f58174b3cb3997c0fcff09276bd7502796 (patch)
treec632dd4fccffbf2415e46e1973d4a40ce1aeb3ac /libdm
parentefaab93491751ccf39108d076745c6774b263232 (diff)
downloadlvm2-548c69f58174b3cb3997c0fcff09276bd7502796.tar.gz
cov: hide reports from optarg being NULL
It's basically irrelavant which value we assing to optarg, since it's set by getopt() function, but Coverity tool is incorrectly reporting possibly dereference of NULL.
Diffstat (limited to 'libdm')
-rw-r--r--libdm/dm-tools/dmsetup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdm/dm-tools/dmsetup.c b/libdm/dm-tools/dmsetup.c
index f6d1ecf90..0f260b3f4 100644
--- a/libdm/dm-tools/dmsetup.c
+++ b/libdm/dm-tools/dmsetup.c
@@ -6680,7 +6680,7 @@ static int _process_losetup_switches(const char *base, int *argcp, char ***argvp
};
#endif
- optarg = 0;
+ optarg = (char*) "";
optind = OPTIND_INIT;
while ((c = GETOPTLONG_FN(*argcp, *argvp, "ade:fo:v",
long_options, NULL)) != -1 ) {
@@ -6976,7 +6976,7 @@ static int _process_switches(int *argcp, char ***argvp, const char *dev_dir)
return r;
}
- optarg = 0;
+ optarg = (char*) "";
optind = OPTIND_INIT;
while ((ind = -1, c = GETOPTLONG_FN(*argcp, *argvp, "cCfG:hj:m:M:no:O:rS:u:U:vy",
long_options, NULL)) != -1) {