(code_convert_region): Fix calculation of `ratio'.
This commit is contained in:
parent
82141d51c9
commit
b3ebb2d471
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue