]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wipefs: fix variable / function shadowing [cppcheck]
authorSami Kerola <kerolasa@iki.fi>
Sat, 18 May 2019 21:39:58 +0000 (22:39 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 18 May 2019 21:42:13 +0000 (22:42 +0100)
[misc-utils/wipefs.c:636] -> [misc-utils/wipefs.c:310]: (style) Local
variable usage shadows outer function

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/wipefs.c

index 78e5ac376ecb5da63daca41834b6ab3d7c6cc170..be728279bd41f862923a73fcbca2dda536756800 100644 (file)
@@ -307,7 +307,7 @@ static struct wipe_desc *get_desc_for_probe(struct wipe_control *ctl,
                                            loff_t *offset,
                                            size_t *len)
 {
-       const char *off, *type, *mag, *p, *usage = NULL;
+       const char *off, *type, *mag, *p, *use = NULL;
        struct wipe_desc *wp;
        int rc, ispt = 0;
 
@@ -328,7 +328,7 @@ static struct wipe_desc *get_desc_for_probe(struct wipe_control *ctl,
                        rc = blkid_probe_lookup_value(pr, "PTMAGIC", &mag, len);
                if (rc)
                        return NULL;
-               usage = N_("partition-table");
+               use = N_("partition-table");
                ispt = 1;
        } else
                return NULL;
@@ -357,8 +357,8 @@ static struct wipe_desc *get_desc_for_probe(struct wipe_control *ctl,
        if (!wp)
                return NULL;
 
-       if (usage || blkid_probe_lookup_value(pr, "USAGE", &usage, NULL) == 0)
-               wp->usage = xstrdup(usage);
+       if (use || blkid_probe_lookup_value(pr, "USAGE", &use, NULL) == 0)
+               wp->usage = xstrdup(use);
 
        wp->type = xstrdup(type);
        wp->on_disk = 1;