changeset 31175:738330ba020f

(char_to_string): Check the character validity. (char_valid_p): If C is not less than MAX_CHAR, be sure to return 0.
author Kenichi Handa <handa@m17n.org>
date Sat, 26 Aug 2000 01:07:49 +0000
parents 109bb1f91963
children 3aeaabf6fcad
files src/charset.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/charset.c	Sat Aug 26 00:36:57 2000 +0000
+++ b/src/charset.c	Sat Aug 26 01:07:49 2000 +0000
@@ -221,7 +221,7 @@
 	  *p++ = c + 0x20;
 	}
     }
-  else if (c < MAX_CHAR)
+  else if (CHAR_VALID_P (c))
     {
       int charset, c1, c2;
 
@@ -1076,7 +1076,7 @@
 {
   int charset, c1, c2;
 
-  if (c < 0)
+  if (c < 0 || c >= MAX_CHAR)
     return 0;
   if (SINGLE_BYTE_CHAR_P (c))
     return 1;