ref: daa2dde19e2b1d27477eaa618157551d3fcd84bb
parent: 1b4ad12272d7250ed8d62d82fca5ca96161bb481
author: Simon Howard <fraggle@gmail.com>
date: Fri Oct 21 20:25:26 EDT 2011
Fix percentage output to match that of statdump.exe. Subversion-branch: /branches/v2-branch Subversion-revision: 2452
--- a/src/doom/statdump.c
+++ b/src/doom/statdump.c
@@ -152,7 +152,12 @@
{
fprintf(stream, "%i / %i", amount, total);
- fprintf(stream, " (%i%%)", (amount * 100) / total);
+ // statdump.exe is a 16-bit program, so very occasionally an
+ // integer overflow can occur when doing this calculation with
+ // a large value. Therefore, cast to short to give the same
+ // output.
+
+ fprintf(stream, " (%i%%)", (short) (amount * 100) / total);
}
}