(code_convert_region): Fix calculation of `ratio'.

This commit is contained in:
Kenichi Handa 2004-12-27 05:51:40 +00:00
parent 82141d51c9
commit b3ebb2d471

View file

@ -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;