From e0b06769888484bf2ea047d2fc8a33a3f549b527 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Fri, 28 Dec 2012 21:23:43 +0000 Subject: losetup: fix declarations [smatch scan] sys-utils/losetup.c:309:2: error: 'for' loop initial declarations are only allowed in C99 mode sys-utils/losetup.c:374:2: error: 'for' loop initial declarations are only allowed in C99 mode Signed-off-by: Sami Kerola --- sys-utils/losetup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys-utils/losetup.c') diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index 2765a38bc..2c81e69ba 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -302,11 +302,12 @@ static int make_table(struct loopdev_cxt *lc, const char *file, { struct stat sbuf, *st = &sbuf; struct tt_line *ln; + int i; if (!(tt = tt_new_table(0))) errx(EXIT_FAILURE, _("failed to initialize output table")); - for (int i = 0; i < ncolumns; i++) { + for (i = 0; i < ncolumns; i++) { struct colinfo *ci = get_column_info(i); if (!tt_define_column(tt, ci->name, ci->whint, ci->flags)) @@ -341,6 +342,8 @@ static int make_table(struct loopdev_cxt *lc, const char *file, static void usage(FILE *out) { + size_t i; + fputs(USAGE_HEADER, out); fprintf(out, @@ -371,7 +374,7 @@ static void usage(FILE *out) fputs(USAGE_VERSION, out); fputs(_("\nAvailable --list columns:\n"), out); - for (size_t i = 0; i < NCOLS; i++) + for (i = 0; i < NCOLS; i++) fprintf(out, " %12s %s\n", infos[i].name, _(infos[i].help)); fprintf(out, USAGE_MAN_TAIL("losetup(8)")); -- cgit v1.2.3-55-g7522