From e7a2efe053a41742b1305ed5e88b158be156e7e8 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 6 Apr 2005 08:26:06 +0000 Subject: [PATCH] do not try to read after EOF --- main/streams/streams.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/streams/streams.c b/main/streams/streams.c index 23b894b2b0..66956a2977 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -847,6 +847,10 @@ PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *re php_stream_fill_read_buffer(stream, maxlen TSRMLS_CC); + if ((stream->writepos - stream->readpos)<=0) { + return NULL; + } + if (delim_len == 0 || !delim) { toread = maxlen; } else { -- 2.50.1