Correct rounding issue when displaying the compression ratio.
committer: mfx <mfx> 1058789628 +0000
This commit is contained in:
parent
4e64cdac15
commit
4205c699ac
@ -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");
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user