Correct rounding issue when displaying the compression ratio.

committer: mfx <mfx> 1058789628 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2003-07-21 12:13:48 +00:00
parent 4e64cdac15
commit 4205c699ac
2 changed files with 2 additions and 2 deletions

View File

@ -151,7 +151,7 @@ static const char *mkline(unsigned long fu_len, unsigned long fc_len,
// Large ratios can happen because of overlays that are
// appended after a program is packed.
unsigned ratio = get_ratio(fu_len, fc_len);
unsigned ratio = get_ratio(fu_len, fc_len) + 50;
#if 1
if (ratio >= 1000*1000)
strcpy(r, "overlay");

View File

@ -533,7 +533,7 @@ unsigned get_ratio(unsigned u_len, unsigned c_len)
const unsigned n = 1000000;
if (u_len <= 0)
return c_len <= 0 ? 0 : n;
return (unsigned) ((c_len * (acc_uint64l_t)n) / u_len) + 5;
return (unsigned) ((c_len * (acc_uint64l_t)n) / u_len);
}