Bugzilla Bug 298612: ensure that the return value of StringGetChar, which
authorwtchang%redhat.com
Fri, 05 Aug 2005 22:44:06 +0000
changeset 3426 84f0079e5240096b928c10d73f8d5435b835d8de
parent 3425 634d9890f9616343c0c24a3aedf52a5c2c9c4f28
child 3427 d38e3ac46d84f70895fc44539815ec36529f49ad
push idunknown
push userunknown
push dateunknown
bugs298612
Bugzilla Bug 298612: ensure that the return value of StringGetChar, which is passed to isspace, etc., is EOF or between 0 and 255. r=darin.
pr/src/io/prscanf.c
--- a/pr/src/io/prscanf.c
+++ b/pr/src/io/prscanf.c
@@ -634,17 +634,17 @@ static int
 StringGetChar(void *stream)
 {
     char *cPtr = *((char **) stream);
 
     if (*cPtr == '\0') {
         return EOF;
     } else {
         *((char **) stream) = cPtr + 1;
-        return *cPtr;
+        return (unsigned char) *cPtr;
     }
 }
 
 static void
 StringUngetChar(void *stream, int ch)
 {
     char *cPtr = *((char **) stream);