From: Kenichi Handa Date: Mon, 27 Dec 2004 05:51:40 +0000 (+0000) Subject: (code_convert_region): Fix calculation of `ratio'. X-Git-Tag: ttn-vms-21-2-B4~3153 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b3ebb2d471ef474f0142637e5e5e4784247d51d7;p=emacs.git (code_convert_region): Fix calculation of `ratio'. --- diff --git a/src/coding.c b/src/coding.c index 93a18d1cd9c..c10d4800cbf 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5881,7 +5881,6 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace) REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG) REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG Here, we are sure that NEW >= ORIG. */ - float ratio; if (coding->produced <= coding->consumed) { @@ -5891,7 +5890,8 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace) } else { - ratio = (coding->produced - coding->consumed) / coding->consumed; + float ratio = coding->produced - coding->consumed; + ratio /= coding->consumed; require = len_byte * ratio; } first = 0;