summaryrefslogtreecommitdiff
path: root/main/memory_streams.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/memory_streams.c')
-rw-r--r--main/memory_streams.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/main/memory_streams.c b/main/memory_streams.c
index 520225c87c..ca5055da8b 100644
--- a/main/memory_streams.c
+++ b/main/memory_streams.c
@@ -89,14 +89,6 @@ static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count
ms = stream->abstract;
assert(ms != NULL);
- if (buf == NULL && count == 0) {
- /* check for EOF condition */
- if (ms->fpos >= ms->fsize) {
- return EOF;
- }
- return 0;
- }
-
if (ms->fpos + count > ms->fsize) {
count = ms->fsize - ms->fpos;
}
@@ -105,6 +97,8 @@ static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count
assert(buf!= NULL);
memcpy(buf, ms->data+ms->fpos, count);
ms->fpos += count;
+ } else {
+ stream->eof = 1;
}
return count;
}