]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
swapon: remove loop declaration [smatch scan]
authorSami Kerola <kerolasa@iki.fi>
Mon, 8 Oct 2012 07:08:20 +0000 (08:08 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 15 Oct 2012 14:53:59 +0000 (16:53 +0200)
sys-utils/swapon.c:677:2: error: 'for' loop initial declarations are
only allowed in C99 mode

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

index 0490cd0ad8856435e5c53db5e25e2ac34522deb0..40df5220c452ef203aa2cfc117a27070d78ca42f 100644 (file)
@@ -642,6 +642,7 @@ static int swapon_all(void)
 
 static void __attribute__ ((__noreturn__)) usage(FILE * out)
 {
+       size_t i;
        fputs(USAGE_HEADER, out);
 
        fprintf(out, _(" %s [options] [<spec>]\n"), program_invocation_short_name);
@@ -674,7 +675,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
                " <file>                 name of file to be used\n"), out);
 
        fputs(_("\nAvailable columns (for --show):\n"), out);
-       for (size_t i = 0; i < NCOLS; i++)
+       for (i = 0; i < NCOLS; i++)
                fprintf(out, " %4s  %s\n", infos[i].name, _(infos[i].help));
 
        fprintf(out, USAGE_MAN_TAIL("swapon(8)"));