Fix signed vs unsigned printf format strings for block and inode numbers
There were still some %d's lurking when we print blocks & inodes; also
many of the counters in the e2fsck_struct were signed, and probably
need to be unsigned to avoid overflows.
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
diff --git a/misc/ChangeLog b/misc/ChangeLog
index 0a5c495..da27353 100644
--- a/misc/ChangeLog
+++ b/misc/ChangeLog
@@ -1,5 +1,11 @@
2006-08-30 Eric Sandeen <esandeen@redhat.com>
+ * dumpe2fs.c (list_bad_blocks):
+ * e2image.c (output_meta_data_blocks, write_raw_image_file):
+ * mke2fs.c (test_disk, handle_bad_blocks): Fix printf formats.
+
+2006-08-30 Eric Sandeen <esandeen@redhat.com>
+
* e2image.c (mark_table_blocks): Remove unused first_block
incrementing from loop.
diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c
index 2a3cf53..4488339 100644
--- a/misc/dumpe2fs.c
+++ b/misc/dumpe2fs.c
@@ -250,10 +250,10 @@
return;
}
if (dump) {
- header = fmt = "%d\n";
+ header = fmt = "%u\n";
} else {
- header = _("Bad blocks: %d");
- fmt = ", %d";
+ header = _("Bad blocks: %u");
+ fmt = ", %u";
}
while (ext2fs_badblocks_list_iterate(bb_iter, &blk)) {
printf(header ? header : fmt, blk);
diff --git a/misc/e2image.c b/misc/e2image.c
index 59bf1e4..5bbc49b 100644
--- a/misc/e2image.c
+++ b/misc/e2image.c
@@ -417,7 +417,7 @@
retval = io_channel_read_blk(fs->io, blk, 1, buf);
if (retval) {
com_err(program_name, retval,
- "error reading block %d", blk);
+ "error reading block %u", blk);
}
if (scramble_block_map &&
ext2fs_test_block_bitmap(scramble_block_map, blk))
@@ -516,7 +516,7 @@
block_buf, process_dir_block, &pb);
if (retval) {
com_err(program_name, retval,
- "while iterating over inode %d",
+ "while iterating over inode %u",
ino);
exit(1);
}
@@ -529,7 +529,7 @@
process_file_block, &pb);
if (retval) {
com_err(program_name, retval,
- "while iterating over %d", ino);
+ "while iterating over inode %u", ino);
exit(1);
}
}
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 01ef546..05ee9d8 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -189,7 +189,7 @@
errcode_t retval;
char buf[1024];
- sprintf(buf, "badblocks -b %d -X %s%s%s %d", fs->blocksize,
+ sprintf(buf, "badblocks -b %d -X %s%s%s %u", fs->blocksize,
quiet ? "" : "-s ", (cflag > 1) ? "-w " : "",
fs->device_name, fs->super->s_blocks_count);
if (verbose)
@@ -233,7 +233,7 @@
if (ext2fs_badblocks_list_test(bb_list, i)) {
fprintf(stderr, _("Block %d in primary "
"superblock/group descriptor area bad.\n"), i);
- fprintf(stderr, _("Blocks %u through %d must be good "
+ fprintf(stderr, _("Blocks %u through %u must be good "
"in order to build a filesystem.\n"),
fs->super->s_first_data_block, must_be_good);
fputs(_("Aborting....\n"), stderr);