don't pass negative maxchars to php_stream_get_line_ex()

This commit is contained in:
Antony Dovgal 2006-12-05 13:45:49 +00:00
parent 07cbe3317a
commit 2f5f375850

View File

@ -2153,7 +2153,7 @@ PHP_FUNCTION(fgetcsv)
}
}
buf.v = php_stream_get_line_ex(stream, stream->readbuf_type, NULL_ZSTR, 0, len, &buf_len);
buf.v = php_stream_get_line_ex(stream, stream->readbuf_type, NULL_ZSTR, 0, (len < 0) ? 0 : len, &buf_len);
if (!buf.v) {
/* No data */
RETVAL_FALSE;