From: Karel Zak Date: Mon, 23 Jul 2018 09:43:30 +0000 (+0200) Subject: mkswap: fix compiler warnings [-Wcast-qual] X-Git-Tag: v2.33-rc1~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f11157e80412da35017fda9cc16984f47b94f542;p=thirdparty%2Futil-linux.git mkswap: fix compiler warnings [-Wcast-qual] Signed-off-by: Karel Zak --- diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index a6077daf09..cbb99dccba 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -259,6 +259,8 @@ static void wipe_device(struct mkswap_control *ctl) blkid_probe pr = NULL; #endif if (!ctl->force) { + const char *v = NULL; + if (lseek(ctl->fd, 0, SEEK_SET) != 0) errx(EXIT_FAILURE, _("unable to rewind swap-device")); @@ -268,9 +270,8 @@ static void wipe_device(struct mkswap_control *ctl) blkid_probe_enable_superblocks(pr, 0); if (blkid_do_fullprobe(pr) == 0 && - blkid_probe_lookup_value(pr, "PTTYPE", - (const char **) &type, NULL) == 0 && type) { - type = xstrdup(type); + blkid_probe_lookup_value(pr, "PTTYPE", &v, NULL) == 0 && v) { + type = xstrdup(v); zap = 0; } #else