mirror of
https://github.com/php/php-src.git
synced 2026-04-02 05:32:28 +02:00
MFB: Fix ftruncate() with negative size
This commit is contained in:
@@ -765,7 +765,7 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
|
||||
return fd == -1 ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK;
|
||||
|
||||
case PHP_STREAM_TRUNCATE_SET_SIZE:
|
||||
return ftruncate(fd, *(size_t*)ptrparam) == 0 ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;
|
||||
return ftruncate(fd, *(ptrdiff_t*)ptrparam) == 0 ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user