]> git.eshelyaron.com Git - emacs.git/commitdiff
(code_convert_region): Fix calculation of `ratio'.
authorKenichi Handa <handa@m17n.org>
Mon, 27 Dec 2004 05:51:40 +0000 (05:51 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 27 Dec 2004 05:51:40 +0000 (05:51 +0000)
src/coding.c

index 93a18d1cd9c666e9a74e3b9a30eb1bba21f5f3e2..c10d4800cbf815e7d4a3bd7ad74e566c2d0ef304 100644 (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;