From b2ba182e8f635d2d97ed07317920422cca90b4e8 Mon Sep 17 00:00:00 2001 From: "Paul N. Hilfinger" Date: Sat, 20 Mar 2004 09:53:03 +0000 Subject: print_percentage: Use floating point to avoid incorrect results when portion*100 overflows. --- gdb/bcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/bcache.c') diff --git a/gdb/bcache.c b/gdb/bcache.c index cadadb5..0bc533e 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)); } -- cgit v1.1