mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-14 03:15:06 +08:00
print_percentage: Use floating point to avoid incorrect results when
portion*100 overflows.
This commit is contained in:
@ -303,7 +303,7 @@ print_percentage (int portion, int total)
|
||||
if (total == 0)
|
||||
printf_filtered ("(not applicable)\n");
|
||||
else
|
||||
printf_filtered ("%3d%%\n", portion * 100 / total);
|
||||
printf_filtered ("%3d%%\n", (int) (portion * 100.0 / total));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user