+2006-10-03 Theodore Tso <tytso@mit.edu>
+
+ * badblocks.c: Fix the interpretation of the last_block parameter
+ on the command line, and adjust the last block count
+ displays in the progress messages.
+ (Addresses Debian Bug #386475)
+
2006-10-02 Theodore Tso <tytso@mit.edu>
* util.c (figure_journal_size): Increase the smallest default
}
if (v_flag) {
fprintf (stderr, _("Checking blocks %lu to %lu\n"), from_count,
- last_block);
+ last_block - 1);
}
if (t_flag) {
fputs(_("Checking for bad blocks in read-only mode\n"), stderr);
flush_bufs();
try = blocks_at_once;
currently_testing = from_count;
- num_blocks = last_block;
+ num_blocks = last_block - 1;
if (!t_flag && (s_flag || v_flag)) {
fputs(_("Checking for bad blocks (read-only test): "), stderr);
if (v_flag <= 1)
for (pat_idx = 0; pat_idx < nr_pattern; pat_idx++) {
pattern_fill(buffer, pattern[pat_idx],
blocks_at_once * block_size);
- num_blocks = last_block;
+ num_blocks = last_block - 1;
currently_testing = from_count;
if (s_flag && v_flag <= 1)
alarm_intr(SIGALRM);
save_ptr = save_base;
test_ptr = test_base;
currently_testing = from_count;
- num_blocks = last_block;
+ num_blocks = last_block - 1;
if (s_flag && v_flag <= 1)
alarm_intr(SIGALRM);
exit(1);
}
} else {
- last_block = strtoul (argv[optind], &tmp, 0);
+ last_block = strtoul (argv[optind], &tmp, 0) + 1;
if (*tmp) {
com_err (program_name, 0, _("invalid blocks count - %s"),
argv[optind]);