From 0e235b7e3ab810cd797fe8d163da7de232832e12 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sat, 26 Aug 2000 01:07:49 +0000 Subject: [PATCH] (char_to_string): Check the character validity. (char_valid_p): If C is not less than MAX_CHAR, be sure to return 0. --- src/charset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charset.c b/src/charset.c index bc0b5ff7ee3..f350572a9d2 100644 --- a/src/charset.c +++ b/src/charset.c @@ -221,7 +221,7 @@ char_to_string (c, str) *p++ = c + 0x20; } } - else if (c < MAX_CHAR) + else if (CHAR_VALID_P (c)) { int charset, c1, c2; @@ -1076,7 +1076,7 @@ char_valid_p (c, genericp) { int charset, c1, c2; - if (c < 0) + if (c < 0 || c >= MAX_CHAR) return 0; if (SINGLE_BYTE_CHAR_P (c)) return 1; -- 2.39.2