From 731a5c51040042a0f344752fee1117701efa3cfd Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 2 Apr 2013 16:31:36 +0200 Subject: [PATCH] keep previous test to avoid any behavior change --- main/streams/streams.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/streams/streams.c b/main/streams/streams.c index 7bc4c9ddb56..cb80e9a16b5 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1535,8 +1535,10 @@ PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size *len = didwrite; - /* read bytes match written */ - if (mapped == didwrite) { + /* we've got at least 1 byte to read + * less than 1 is an error + * AND read bytes match written */ + if (mapped > 0 && mapped == didwrite) { return SUCCESS; } return FAILURE;