]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wipefs: fix compiler warning
authorKarel Zak <kzak@redhat.com>
Wed, 20 Jan 2021 08:20:54 +0000 (09:20 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Jan 2021 08:20:54 +0000 (09:20 +0100)
misc-utils/wipefs.c: In function ‘main’:
misc-utils/wipefs.c:838:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
misc-utils/wipefs.c:838:3: note: use option -std=c99 or -std=gnu99 to compile your code

Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/wipefs.c

index 77dfe6a28fdd08f8005bfe336e145baced1776aa..1b265b48cf6354ce2d96089bda2b9661684c3062 100644 (file)
@@ -684,6 +684,7 @@ main(int argc, char **argv)
 {
        struct wipe_control ctl = { .devname = NULL };
        int c;
+       size_t i;
        char *outarg = NULL;
        enum {
                OPT_LOCK = CHAR_MAX + 1,
@@ -835,7 +836,7 @@ main(int argc, char **argv)
                /* Re-read partition tables on whole-disk devices. This is
                 * postponed until all is done to avoid conflicts.
                 */
-               for (size_t i = 0; i < ctl.nrereads; i++) {
+               for (i = 0; i < ctl.nrereads; i++) {
                        char *devname = ctl.reread[i];
                        int fd = open(devname, O_RDONLY);