conversion, pay attention to the case that coding->produced is not
greater than coding->consumed.
REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG)
REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG
Here, we are sure that NEW >= ORIG. */
- float ratio = coding->produced - coding->consumed;
- ratio /= coding->consumed;
- require = len_byte * ratio;
+ float ratio;
+
+ if (coding->produced <= coding->consumed)
+ {
+ /* This happens because of CCL-based coding system with
+ eol-type CRLF. */
+ require = 0;
+ }
+ else
+ {
+ ratio = (coding->produced - coding->consumed) / coding->consumed;
+ require = len_byte * ratio;
+ }
first = 0;
}
if ((src - dst) < (require + 2000))