changeset 23202:750deb2c6c0b

(STRING_CHAR_AND_LENGTH): Return correct value in ACTUAL_LEN even if LEN is too short to have a valid multibyte form. (STRING_CHAR_AND_CHAR_LENGTH): Likewise.
author Kenichi Handa <handa@m17n.org>
date Mon, 07 Sep 1998 13:39:15 +0000
parents 392b44751a22
children a4e688757109
files src/charset.h
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/charset.h	Mon Sep 07 13:39:15 1998 +0000
+++ b/src/charset.h	Mon Sep 07 13:39:15 1998 +0000
@@ -587,16 +587,14 @@
    MULTIBYTE_FORM_LENGTH.  */
 
 #define STRING_CHAR_AND_LENGTH(str, len, actual_len)	    	\
-  ((BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1	    	\
-    || BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) > (len))	\
+  (BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1		\
    ? (actual_len = 1), (unsigned char) *(str)		    	\
    : string_to_non_ascii_char (str, len, &actual_len, 0))
 
 /* This is like STRING_CHAR_AND_LENGTH but the third arg ACTUAL_LEN
    does not include garbage bytes following the multibyte character.  */
-#define STRING_CHAR_AND_CHAR_LENGTH(str, len, actual_len)	    	\
-  ((BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1	    	\
-    || BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) > (len))	\
+#define STRING_CHAR_AND_CHAR_LENGTH(str, len, actual_len)    	\
+  (BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1		\
    ? (actual_len = 1), (unsigned char) *(str)		    	\
    : string_to_non_ascii_char (str, len, &actual_len, 1))