Commit b3ebb2d4 authored by Kenichi Handa's avatar Kenichi Handa

(code_convert_region): Fix calculation of `ratio'.

parent 82141d51
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment