changeset 30831:6d8233c42de8

(CCL_WRITE_CHAR): If CH is eight-bit-control char, decrement dst_end to avoid buffer overflow in the later call of string_as_multibyte
author Kenichi Handa <handa@m17n.org>
date Wed, 16 Aug 2000 01:36:35 +0000
parents 8395ff348b8e
children b0b1acff966b
files src/ccl.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ccl.c	Wed Aug 16 01:36:13 2000 +0000
+++ b/src/ccl.c	Wed Aug 16 01:36:35 2000 +0000
@@ -685,7 +685,13 @@
 	      *dst++ = '\n';					\
 	  }							\
 	else if (bytes == 1)					\
-	  *dst++ = (ch);					\
+	  {							\
+	    *dst++ = (ch);					\
+	    if ((ch) >= 0x80 && (ch) < 0xA0)			\
+	      /* We may have to convert this eight-bit char to	\
+		 multibyte form later.  */			\
+	      dst_end--;					\
+	  }							\
 	else							\
 	  dst += CHAR_STRING (ch, dst);				\
       }								\