1
0
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:
Intel A80486DX2-66 2024-11-20 20:40:51 +03:00
parent 1890b3d294
commit 4f13f77108
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -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);