Make sure to pass unsigned chars to isspace(), per the C standard; not doing so

can cause problems on powerpc and other architectures.

Gbp-Pq: Name 0002-ctype.patch
This commit is contained in:
Colin Watson 2022-05-13 23:17:04 +08:00 committed by openKylinBot
parent d8b9cce648
commit d3c945abcc
1 changed files with 2 additions and 2 deletions

View File

@ -658,7 +658,7 @@ char *next_word(char **ptr)
*word = 0; *word = 0;
while(isspace(*s)) if(*s++ == '\n') line++; while(isspace((unsigned char) *s)) if(*s++ == '\n') line++;
if(!*s) { if(!*s) {
*ptr = s; *ptr = s;
@ -757,7 +757,7 @@ char *next_word(char **ptr)
word[n] = 0; word[n] = 0;
} }
else { else {
while(!isspace(*s)) s++; while(!isspace((unsigned char) *s)) s++;
} }
if(!is_str) { if(!is_str) {