f3read: avoid surprising warning message

When f3read is called without parameters --start-at and --end-at,
and a F3 file is missing, f3read shows the following warning:

WARNING: Not all F3 files in the range 1 to 9223372036854775807 are available

This message surprises users, see issue below:
https://github.com/AltraMayor/f3/issues/53

This patch adopts the number of the last file available to compose
the message, so in the example of the issue above, it would be 1741.
This commit is contained in:
Michel Machado
2016-11-04 10:01:22 -04:00
parent 98a2ea77ec
commit f1a7eead90

View File

@@ -252,7 +252,9 @@ static void iterate_files(const char *path, const long *files,
const char *unit;
int and_read_all = 1;
int or_missing_file = 0;
int number = start_at;
long number = start_at;
UNUSED(end_at);
tot_ok = tot_corrupted = tot_changed = tot_overwritten = tot_size = 0;
printf(" SECTORS "
@@ -299,7 +301,7 @@ static void iterate_files(const char *path, const long *files,
report("\t Overwritten:", tot_overwritten);
if (or_missing_file)
printf("WARNING: Not all F3 files in the range %li to %li are available\n",
start_at + 1, end_at + 1);
start_at + 1, number);
if (!and_read_all)
printf("WARNING: Not all data was read due to I/O error(s)\n");