summaryrefslogtreecommitdiff
path: root/ext/standard/php_fopen_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/php_fopen_wrapper.c')
-rw-r--r--ext/standard/php_fopen_wrapper.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index cfaad71e0f..50d5e50035 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -73,7 +73,7 @@ static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t
static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
{
- int read_bytes;
+ size_t read_bytes = 0;
if(!stream->eof) {
if(SG(request_info).post_data) { /* data has already been read by a post handler */
read_bytes = SG(request_info).post_data_length - stream->position;
@@ -85,16 +85,16 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count
if(read_bytes) {
memcpy(buf, SG(request_info).post_data + stream->position, read_bytes);
}
- return read_bytes;
} else {
read_bytes = sapi_module.read_post(buf, count TSRMLS_CC);
if(read_bytes <= 0){
stream->eof = 1;
read_bytes = 0;
}
- return read_bytes;
}
}
+
+ return read_bytes;
}
static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC)