From 4205c699acd696c39cc12deb1925edf65f373ffd Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 21 Jul 2003 12:13:48 +0000 Subject: [PATCH] Correct rounding issue when displaying the compression ratio. committer: mfx 1058789628 +0000 --- src/ui.cpp | 2 +- src/util.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui.cpp b/src/ui.cpp index d7c395aa..c161ff43 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -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"); diff --git a/src/util.cpp b/src/util.cpp index f3870006..350bfdc4 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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); }