mirror of
https://git.disroot.org/80486DX2-66/polonium.git
synced 2024-12-27 23:50:29 +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');
|
putchar('\n');
|
||||||
|
|
||||||
if (result.damaged_bytes) {
|
printf("Byte hit counter: %" PRIuMAX " hits, %" PRIuMAX " passes\n",
|
||||||
size_t dmg = result.damaged_bytes, fsize = result.file_size,
|
(uintmax_t) result.damaged_bytes,
|
||||||
passes = param.passes;
|
(uintmax_t) 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");
|
|
||||||
|
|
||||||
// finish working with the file
|
// finish working with the file
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
Loading…
Reference in New Issue
Block a user