1
0
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:
Hannes Magnusson
2006-11-16 16:08:09 +00:00
parent c41f14297c
commit 9da991dd50

View File

@@ -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: