]> err.no Git - util-linux/commitdiff
mkfs.minix: clean up gcc warnings
authorRandy Dunlap <randy.dunlap@oracle.com>
Sat, 29 Sep 2007 08:11:29 +0000 (01:11 -0700)
committerKarel Zak <kzak@redhat.com>
Wed, 10 Oct 2007 22:30:06 +0000 (00:30 +0200)
* 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 <randy.dunlap@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkfs.minix.c

index 8a81e7cadc750866d30a3756023e95f378264639..7cd0958fb6ffebf26c30aa19ee6306e197549c02 100644 (file)
@@ -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++;
        }