comparison lib-src/fakemail.c @ 34609:cb2667416fa5

(get_keyword): Make sure that isspace and similar aren't called with a negative argument.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 15 Dec 2000 14:33:25 +0000
parents 134b57acef68
children 1efc40541908
comparison
equal deleted inserted replaced
34608:9286b7ab7104 34609:cb2667416fa5
251 register char *field; 251 register char *field;
252 char **rest; 252 char **rest;
253 { 253 {
254 static char keyword[KEYWORD_SIZE]; 254 static char keyword[KEYWORD_SIZE];
255 register char *ptr; 255 register char *ptr;
256 register char c; 256 register int c;
257 257
258 ptr = &keyword[0]; 258 ptr = &keyword[0];
259 c = *field++; 259 c = (unsigned char) *field++;
260 if (isspace (c) || c == ':') 260 if (isspace (c) || c == ':')
261 return ((char *) NULL); 261 return ((char *) NULL);
262 *ptr++ = (islower (c) ? toupper (c) : c); 262 *ptr++ = (islower (c) ? toupper (c) : c);
263 while (((c = *field++) != ':') && ! isspace (c)) 263 while (((c = (unsigned char) *field++) != ':') && ! isspace (c))
264 *ptr++ = (islower (c) ? toupper (c) : c); 264 *ptr++ = (islower (c) ? toupper (c) : c);
265 *ptr++ = '\0'; 265 *ptr++ = '\0';
266 while (isspace (c)) 266 while (isspace (c))
267 c = *field++; 267 c = (unsigned char) *field++;
268 if (c != ':') 268 if (c != ':')
269 return ((char *) NULL); 269 return ((char *) NULL);
270 *rest = field; 270 *rest = field;
271 return &keyword[0]; 271 return &keyword[0];
272 } 272 }