1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2021-09-19 20:19:52 +02:00
parent efaab93491
commit 548c69f581
2 changed files with 3 additions and 3 deletions

View File

@ -6680,7 +6680,7 @@ static int _process_losetup_switches(const char *base, int *argcp, char ***argvp
}; };
#endif #endif
optarg = 0; optarg = (char*) "";
optind = OPTIND_INIT; optind = OPTIND_INIT;
while ((c = GETOPTLONG_FN(*argcp, *argvp, "ade:fo:v", while ((c = GETOPTLONG_FN(*argcp, *argvp, "ade:fo:v",
long_options, NULL)) != -1 ) { long_options, NULL)) != -1 ) {
@ -6976,7 +6976,7 @@ static int _process_switches(int *argcp, char ***argvp, const char *dev_dir)
return r; return r;
} }
optarg = 0; optarg = (char*) "";
optind = OPTIND_INIT; optind = OPTIND_INIT;
while ((ind = -1, c = GETOPTLONG_FN(*argcp, *argvp, "cCfG:hj:m:M:no:O:rS:u:U:vy", while ((ind = -1, c = GETOPTLONG_FN(*argcp, *argvp, "cCfG:hj:m:M:no:O:rS:u:U:vy",
long_options, NULL)) != -1) { long_options, NULL)) != -1) {

View File

@ -2236,7 +2236,7 @@ static int _process_command_line(struct cmd_context *cmd, int *argc, char ***arg
*ptr = '\0'; *ptr = '\0';
memset(o, 0, sizeof(*o)); memset(o, 0, sizeof(*o));
optarg = 0; optarg = (char*) "";
optind = OPTIND_INIT; optind = OPTIND_INIT;
while ((goval = GETOPTLONG_FN(*argc, *argv, str, opts, NULL)) >= 0) { while ((goval = GETOPTLONG_FN(*argc, *argv, str, opts, NULL)) >= 0) {