* 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>
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++;
}