]> granicus.if.org Git - php/commitdiff
fix fgetc() & compile warnings
authorAntony Dovgal <tony2001@php.net>
Fri, 12 Aug 2005 19:27:45 +0000 (19:27 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 12 Aug 2005 19:27:45 +0000 (19:27 +0000)
ext/standard/file.c

index 009c9e6bd5f5ff72d14e67a089b76881ce2d48a7..89f95c870ab322a8355f00e9b8f4ab60182c69f5 100644 (file)
@@ -1109,13 +1109,13 @@ PHPAPI PHP_FUNCTION(fgetc)
                RETVAL_FALSE;
        } else {
                if (is_unicode) {
-                       UChar *ubuf = buf;
+                       UChar *ubuf = (UChar *)buf;
                        int32_t num_u16 = num_bytes >> 1;
                        ubuf[num_u16] = 0;
-                       RETURN_UNICODEL(ubuf, num_u16, 0);
+                       RETURN_UNICODEL(ubuf, num_u16, 1);
                } else {
                        buf[1] = 0;
-                       RETURN_STRINGL(buf, 1, 0);
+                       RETURN_STRINGL(buf, 1, 1);
                }
        }
 }
@@ -1868,7 +1868,7 @@ PHPAPI PHP_FUNCTION(fread)
 
                buf[num_bytes] = 0;
                buf[num_bytes + 1] = 0;
-               RETURN_UNICODEL(buf, num_bytes >> 1, 0);
+               RETURN_UNICODEL((UChar *)buf, num_bytes >> 1, 0);
        } else {
                buf[num_bytes] = 0;
                if (PG(magic_quotes_runtime)) {