]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mkswap: fix compiler warnings [-Wcast-qual]
authorKarel Zak <kzak@redhat.com>
Mon, 23 Jul 2018 09:43:30 +0000 (11:43 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Jul 2018 09:43:30 +0000 (11:43 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkswap.c

index a6077daf09dbf981be8363879395064248d9bd05..cbb99dccba412c4dfe20f792b2c8d4c3f2110826 100644 (file)
@@ -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