summaryrefslogtreecommitdiff
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2004-12-27 05:51:40 +0000
committerKenichi Handa <handa@m17n.org>2004-12-27 05:51:40 +0000
commitb3ebb2d471ef474f0142637e5e5e4784247d51d7 (patch)
treee84909fa74c438386ed89c85ce447eb9238190d0 /src/coding.c
parent82141d51c9cf0b7b75cec74d81c641ee73150b1d (diff)
downloademacs-b3ebb2d471ef474f0142637e5e5e4784247d51d7.tar.gz
(code_convert_region): Fix calculation of `ratio'.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c4
1 files changed, 2 insertions, 2 deletions
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;