diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2004-10-11 18:31:49 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2004-10-11 18:31:49 +0000 |
| commit | 5c04e39383fcf889c5b7824299d0232e5477a9b3 (patch) | |
| tree | 95d04bbe431da866b6c76fe03e454765f923286b /main/streams/streams.c | |
| parent | f8a4d8a4d5f379cfedb57aa4ed41a8c682585cc5 (diff) | |
| download | php-git-5c04e39383fcf889c5b7824299d0232e5477a9b3.tar.gz | |
Fixed bug #30362 (stream_get_line() not handling end string correctly).
Diffstat (limited to 'main/streams/streams.c')
| -rwxr-xr-x | main/streams/streams.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c index 6242afcf82..9a071746bc 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -846,7 +846,7 @@ 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 (delim_len == 0) { + if (delim_len == 0 || !delim) { toread = maxlen; } else { if (delim_len == 1) { @@ -870,6 +870,7 @@ PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *re *returned_len = php_stream_read(stream, buf, toread); if (*returned_len >= 0) { + buf[*returned_len] = '\0'; return buf; } else { efree(buf); |
