diff options
author | Antony Dovgal <tony2001@php.net> | 2005-08-12 19:27:45 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2005-08-12 19:27:45 +0000 |
commit | 363d0aa028f82d26d3f53364f8208d62c87f144d (patch) | |
tree | 1ba99adaac604945a55037a630fdf30eed4a8a29 | |
parent | 9ab69a286beb5b3ffb711c81e660ba63bcf0f21f (diff) | |
download | php-git-363d0aa028f82d26d3f53364f8208d62c87f144d.tar.gz |
fix fgetc() & compile warnings
-rw-r--r-- | ext/standard/file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c index 009c9e6bd5..89f95c870a 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -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)) { |