From: Hannes Magnusson Date: Thu, 16 Nov 2006 16:08:09 +0000 (+0000) Subject: MFB: Fix ftruncate() with negative size X-Git-Tag: RELEASE_1_0_0RC1~984 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9da991dd506890bbbe88e01ab9ed344a17a45809;p=php MFB: Fix ftruncate() with negative size --- diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 36a055e8fb..1b9e1c2501 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -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: