aboutsummaryrefslogtreecommitdiffstats
path: root/src/character.c
diff options
context:
space:
mode:
authorKenichi Handa2007-04-11 11:52:06 +0000
committerKenichi Handa2007-04-11 11:52:06 +0000
commit5aa91c9b309580af4fc0bad22a10531ed45bb7a2 (patch)
tree5f62af341645ea624288153af5ec3fae38f336c1 /src/character.c
parent57cb2e6f261bb0aad81a9f7e6f3017b54adee068 (diff)
downloademacs-5aa91c9b309580af4fc0bad22a10531ed45bb7a2.tar.gz
emacs-5aa91c9b309580af4fc0bad22a10531ed45bb7a2.zip
(char_string): Type of arg C changed to unsigned.
Signal an error if C is an invalid character code.
Diffstat (limited to 'src/character.c')
-rw-r--r--src/character.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/character.c b/src/character.c
index 29a7f80ae49..dd3771fc280 100644
--- a/src/character.c
+++ b/src/character.c
@@ -100,7 +100,7 @@ char unibyte_has_multibyte_table[256];
100 100
101int 101int
102char_string (c, p) 102char_string (c, p)
103 int c; 103 unsigned c;
104 unsigned char *p; 104 unsigned char *p;
105{ 105{
106 int bytes; 106 int bytes;
@@ -169,11 +169,13 @@ char_string (c, p)
169 p[4] = (0x80 | (c & 0x3F)); 169 p[4] = (0x80 | (c & 0x3F));
170 bytes = 5; 170 bytes = 5;
171 } 171 }
172 else 172 else if (c <= MAX_CHAR)
173 { 173 {
174 c = CHAR_TO_BYTE8 (c); 174 c = CHAR_TO_BYTE8 (c);
175 bytes = BYTE8_STRING (c, p); 175 bytes = BYTE8_STRING (c, p);
176 } 176 }
177 else
178 error ("Invalid character: %d", c);
177 179
178 return bytes; 180 return bytes;
179} 181}