1
0
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:
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'); 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);