]> granicus.if.org Git - php/commitdiff
MFH(r1.307): Fixed bug #21689
authorMoriyoshi Koizumi <moriyoshi@php.net>
Tue, 18 Feb 2003 15:22:46 +0000 (15:22 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Tue, 18 Feb 2003 15:22:46 +0000 (15:22 +0000)
ext/standard/file.c

index 804ec8486e6c8f484695e28d2638084c55f280e6..fbb5a3297a28001a928a0e09bced1ea73ecdb0b4 100644 (file)
@@ -2181,7 +2181,7 @@ PHP_FUNCTION(fgetcsv)
        lineEnd = emalloc(len + 1);
        bptr = buf;
        tptr = buf + strlen(buf) -1;
-       while ( isspace((int) *tptr) && (*tptr!=delimiter) && (tptr > bptr) ) tptr--;
+       while ( isspace((int)*(unsigned char *)tptr) && (*tptr!=delimiter) && (tptr > bptr) ) tptr--;
        tptr++;
        strcpy(lineEnd, tptr);
 
@@ -2203,7 +2203,7 @@ PHP_FUNCTION(fgetcsv)
 
        do {
                /* 1. Strip any leading space */
-               while(isspace((int) *bptr) && (*bptr!=delimiter)) bptr++;
+               while(isspace((int)*(unsigned char *)bptr) && (*bptr!=delimiter)) bptr++;
                /* 2. Read field, leaving bptr pointing at start of next field */
                if (enclosure && *bptr == enclosure) {
                        bptr++; /* move on to first character in field */
@@ -2252,7 +2252,7 @@ PHP_FUNCTION(fgetcsv)
                                                temp = erealloc(temp, temp_len+1);
                                                bptr = buf;
                                                tptr = buf + strlen(buf) -1;
-                                               while (isspace((int) *tptr) && (*tptr!=delimiter) && (tptr > bptr)) 
+                                               while (isspace((int)*(unsigned char *)tptr) && (*tptr!=delimiter) && (tptr > bptr)) 
                                                        tptr--;
                                                tptr++; 
                                                strcpy(lineEnd, tptr);
@@ -2273,7 +2273,7 @@ PHP_FUNCTION(fgetcsv)
 
                        if (strlen(temp)) {
                                tptr--;
-                               while (isspace((int)*tptr) && (*tptr!=delimiter)) 
+                               while (isspace((int)*(unsigned char *)tptr) && (*tptr!=delimiter)) 
                                        *tptr-- = 0;    /* strip any trailing spaces */
                        }