diff options
author | Paul N. Hilfinger <hilfinger@adacore.com> | 2004-03-20 09:53:03 +0000 |
---|---|---|
committer | Paul N. Hilfinger <hilfinger@adacore.com> | 2004-03-20 09:53:03 +0000 |
commit | b2ba182e8f635d2d97ed07317920422cca90b4e8 (patch) | |
tree | 3fd679500e2a5f9fc286010375cb7c4085f04dc1 /gdb/bcache.c | |
parent | * emulparams/elf32frvfd.sh (MAXPAGESIZE): Change to 16Kb. (diff) | |
download | binutils-gdb-b2ba182e8f635d2d97ed07317920422cca90b4e8.tar.gz binutils-gdb-b2ba182e8f635d2d97ed07317920422cca90b4e8.tar.bz2 binutils-gdb-b2ba182e8f635d2d97ed07317920422cca90b4e8.zip |
print_percentage: Use floating point to avoid incorrect results when
portion*100 overflows.
Diffstat (limited to 'gdb/bcache.c')
-rw-r--r-- | gdb/bcache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/bcache.c b/gdb/bcache.c index cadadb5cce6..0bc533ebfef 100644 --- a/gdb/bcache.c +++ b/gdb/bcache.c @@ -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)); } |