blob: 7e7a3722e6bb25c0c20e96d43d1c5b5d5be48904 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
From: Colin Watson <cjwatson@debian.org>
Date: Sun, 3 Jan 2021 02:06:39 -0800
Subject: Make sure to pass unsigned chars to isspace(), per the C standard;
not doing so
can cause problems on powerpc and other architectures.
---
gfxboot-compile.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfxboot-compile.c b/gfxboot-compile.c
index 835450e..0914d53 100644
--- a/gfxboot-compile.c
+++ b/gfxboot-compile.c
@@ -658,7 +658,7 @@ char *next_word(char **ptr)
*word = 0;
- while(isspace(*s)) if(*s++ == '\n') line++;
+ while(isspace((unsigned char) *s)) if(*s++ == '\n') line++;
if(!*s) {
*ptr = s;
@@ -757,7 +757,7 @@ char *next_word(char **ptr)
word[n] = 0;
}
else {
- while(!isspace(*s)) s++;
+ while(!isspace((unsigned char) *s)) s++;
}
if(!is_str) {
|