diff options
| author | Kenichi Handa | 2000-08-26 01:07:49 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-08-26 01:07:49 +0000 |
| commit | 0e235b7e3ab810cd797fe8d163da7de232832e12 (patch) | |
| tree | 448f8246fdee87fe9b8b144af311ccf2e861223f /src | |
| parent | 71c72a72acf82b30427028c11ec64e11e06c705a (diff) | |
| download | emacs-0e235b7e3ab810cd797fe8d163da7de232832e12.tar.gz emacs-0e235b7e3ab810cd797fe8d163da7de232832e12.zip | |
(char_to_string): Check the character validity.
(char_valid_p): If C is not less than MAX_CHAR, be sure to return 0.
Diffstat (limited to 'src')
| -rw-r--r-- | src/charset.c | 4 |
1 files 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) | |||
| 221 | *p++ = c + 0x20; | 221 | *p++ = c + 0x20; |
| 222 | } | 222 | } |
| 223 | } | 223 | } |
| 224 | else if (c < MAX_CHAR) | 224 | else if (CHAR_VALID_P (c)) |
| 225 | { | 225 | { |
| 226 | int charset, c1, c2; | 226 | int charset, c1, c2; |
| 227 | 227 | ||
| @@ -1076,7 +1076,7 @@ char_valid_p (c, genericp) | |||
| 1076 | { | 1076 | { |
| 1077 | int charset, c1, c2; | 1077 | int charset, c1, c2; |
| 1078 | 1078 | ||
| 1079 | if (c < 0) | 1079 | if (c < 0 || c >= MAX_CHAR) |
| 1080 | return 0; | 1080 | return 0; |
| 1081 | if (SINGLE_BYTE_CHAR_P (c)) | 1081 | if (SINGLE_BYTE_CHAR_P (c)) |
| 1082 | return 1; | 1082 | return 1; |