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) { diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index de70e63c9..7c5930006 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -2236,7 +2236,7 @@ static int _process_command_line(struct cmd_context *cmd, int *argc, char ***arg *ptr = '\0'; memset(o, 0, sizeof(*o)); - optarg = 0; + optarg = (char*) ""; optind = OPTIND_INIT; while ((goval = GETOPTLONG_FN(*argc, *argv, str, opts, NULL)) >= 0) {