mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
fix fgetc() & compile warnings
This commit is contained in:
parent
9ab69a286b
commit
363d0aa028
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user