From: Randy Dunlap Date: Sat, 29 Sep 2007 08:11:29 +0000 (-0700) Subject: mkfs.minix: clean up gcc warnings X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e30cb0ed72c2545ae873964b324a7f68211eb88f;p=util-linux mkfs.minix: clean up gcc warnings * clean up code, gcc warnings (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2") Builds cleanly on x86_32 and x86_64. mkfs.minix.c:595: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result Signed-off-by: Randy Dunlap Signed-off-by: Karel Zak --- diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index 8a81e7ca..7cd0958f 100644 --- a/disk-utils/mkfs.minix.c +++ b/disk-utils/mkfs.minix.c @@ -592,7 +592,10 @@ get_list_blocks(char *filename) { die(_("can't open file of bad blocks")); while (!feof(listfile)) { - fscanf(listfile,"%ld\n", &blockno); + if (fscanf(listfile,"%ld\n", &blockno) != 1) { + printf(_("badblock number input error on line %d\n"), badblocks + 1); + die(_("cannot read badblocks file")); + } mark_zone(blockno); badblocks++; }