Mercurial > emacs
diff src/ccl.c @ 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 | 4687d69de88a |
children | 947edf38ac6f |
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); \ } \