summaryrefslogtreecommitdiff
path: root/debian/patches/0002-ctype.patch
blob: aa8f231a2a27aa8ec1b03f7a8375164f1af8e2fa (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
Author: Colin Watson <cjwatson@debian.org>
Description:
 Make sure to pass unsigned chars to isspace(), per the C standard; not doing so
 can cause problems on powerpc and other architectures.

diff -Naurp gfxboot.orig/gfxboot-compile.c gfxboot/gfxboot-compile.c
--- gfxboot.orig/gfxboot-compile.c
+++ gfxboot/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) {