diff --git a/ext/standard/tests/file/file_put_contents_5gb.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_5gb.phpt similarity index 60% rename from ext/standard/tests/file/file_put_contents_5gb.phpt rename to ext/standard/tests/file/file_get_contents_file_put_contents_5gb.phpt index d552d86279d03..854996a6481e7 100644 --- a/ext/standard/tests/file/file_put_contents_5gb.phpt +++ b/ext/standard/tests/file/file_get_contents_file_put_contents_5gb.phpt @@ -1,5 +1,5 @@ --TEST-- -Test file_put_contents() function with 5GB string +Test file_put_contents() and file_get_contents() functions with 5GB string --SKIPIF-- --CLEAN-- --EXPECT-- File written successfully. +File read successfully. diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index c77bd1e2415a8..c92b76d196da0 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -54,7 +54,7 @@ extern int php_get_gid_by_name(const char *name, gid_t *gid); #endif #if defined(PHP_WIN32) -# define PLAIN_WRAP_BUF_SIZE(st) (((st) > UINT_MAX) ? UINT_MAX : (unsigned int)(st)) +# define PLAIN_WRAP_BUF_SIZE(st) ((unsigned int)(st > INT_MAX ? INT_MAX : st)) #define fsync _commit #define fdatasync fsync #else @@ -354,7 +354,7 @@ static ssize_t php_stdiop_write(php_stream *stream, const char *buf, size_t coun if (data->fd >= 0) { #ifdef PHP_WIN32 - ssize_t bytes_written = _write(data->fd, buf, (unsigned int)(count > INT_MAX ? INT_MAX : count)); + ssize_t bytes_written = _write(data->fd, buf, PLAIN_WRAP_BUF_SIZE(count)); #else ssize_t bytes_written = write(data->fd, buf, count); #endif