changeset 4525:d64f1060cd65

Fix off-by-one error in ccl_driver. <87iqr7v7p0.fsf@uwakimon.sk.tsukuba.ac.jp>
author Stephen J. Turnbull <stephen@xemacs.org>
date Sat, 01 Nov 2008 23:32:53 +0900
parents 03ba50f7ecd7
children 38493c0fb952
files src/ChangeLog src/mule-ccl.c src/text.c
diffstat 3 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Oct 29 04:02:05 2008 +0900
+++ b/src/ChangeLog	Sat Nov 01 23:32:53 2008 +0900
@@ -1,3 +1,8 @@
+2008-11-01  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* mule-ccl.c (ccl_driver): Fix off-by-one error.
+	By Julian Bradfield in <18691.16568.526264.972026@krk.inf.ed.ac.uk>.
+
 2008-10-25  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* lisp.h (static_pro): Cast out a warning.
--- a/src/mule-ccl.c	Wed Oct 29 04:02:05 2008 +0900
+++ b/src/mule-ccl.c	Sat Nov 01 23:32:53 2008 +0900
@@ -1455,7 +1455,7 @@
 		  if (XCHARSET_DIMENSION (charset_by_leading_byte (i)) == 1)
 		    i = (((i - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7)
 			 | (reg[rrr] & 0x7F));
-		  else if (i < MAX_LEADING_BYTE_OFFICIAL_2)
+		  else if (i <= MAX_LEADING_BYTE_OFFICIAL_2)
 		    i = ((i - FIELD1_TO_OFFICIAL_LEADING_BYTE) << 14) 
 		      | reg[rrr];
 		  else
--- a/src/text.c	Wed Oct 29 04:02:05 2008 +0900
+++ b/src/text.c	Sat Nov 01 23:32:53 2008 +0900
@@ -3018,7 +3018,7 @@
       int record = x - best_below_byte > 5000;
 
 #ifdef OLD_LOOP /* old code */
-      while (best_below_byte < x)
+       (best_below_byte < x)
 	{
 	  best_below++;
 	  INC_BYTEBPOS (buf, best_below_byte);