bitmap: print correct percentage of bitmap in use.

We were adding 1, presumably to avoid div-by-zero possibilities.
It is better to only substitute '1' if the value actually is zero,
else for small numbers of bits the difference is visible.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-12-23 09:07:14 +11:00
parent 7b80ad6af2
commit 6c9a5fa103
1 changed files with 1 additions and 1 deletions

View File

@ -334,7 +334,7 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st)
goto free_info;
printf(" Bitmap : %llu bits (chunks), %llu dirty (%2.1f%%)\n",
info->total_bits, info->dirty_bits,
100.0 * info->dirty_bits / (info->total_bits + 1));
100.0 * info->dirty_bits / (info->total_bits?:1));
free_info:
free(info);
return rv;