mirror of
https://git.disroot.org/80486DX2-66/polonium.git
synced 2024-12-26 15:10:40 +05:30
main.c: simplify the byte hit counter
This commit is contained in:
parent
1890b3d294
commit
4f13f77108
12
src/main.c
12
src/main.c
@ -417,15 +417,9 @@ int main(int argc, char** argv) {
|
||||
|
||||
putchar('\n');
|
||||
|
||||
if (result.damaged_bytes) {
|
||||
size_t dmg = result.damaged_bytes, fsize = result.file_size,
|
||||
passes = param.passes;
|
||||
printf("Byte hit counter: %" PRIuMAX " / %" PRIuMAX " = %.3Lf%%\n",
|
||||
(uintmax_t) dmg,
|
||||
(uintmax_t) (fsize * passes),
|
||||
((long double) dmg * 100.l) / (long double) (fsize * passes));
|
||||
} else
|
||||
puts("No bytes were damaged");
|
||||
printf("Byte hit counter: %" PRIuMAX " hits, %" PRIuMAX " passes\n",
|
||||
(uintmax_t) result.damaged_bytes,
|
||||
(uintmax_t) param.passes);
|
||||
|
||||
// finish working with the file
|
||||
fclose(file);
|
||||
|
Loading…
Reference in New Issue
Block a user