mirror of
https://github.com/AltraMayor/f3.git
synced 2025-12-13 20:39:59 +01:00
f3read: tighten assert()
The last assert() in iterate_files() was doing an integer division before comparing values, so there was potential for a bug going silent due to the truncation fo the integer division. This patch rewrite the test with a multiplication.
This commit is contained in:
2
f3read.c
2
f3read.c
@@ -382,7 +382,7 @@ static void iterate_files(const char *path, const long *files,
|
||||
files++;
|
||||
}
|
||||
assert(!gettimeofday(&t2, NULL));
|
||||
assert(tot_size / SECTOR_SIZE ==
|
||||
assert(tot_size == SECTOR_SIZE *
|
||||
(tot_ok + tot_corrupted + tot_changed + tot_overwritten));
|
||||
|
||||
/* Notice that not reporting `missing' files after the last file
|
||||
|
||||
Reference in New Issue
Block a user