From cd4262eedd9da3c6b1d4292075842902b36704ea Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 14 Jan 2004 14:25:01 +0000 Subject: [PATCH] Fix #26772: fgets returns NULL instead of FALSE. --- ext/standard/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index 21a10cb3f0c..79abc8aa1eb 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -907,7 +907,11 @@ PHPAPI PHP_FUNCTION(fgets) WRONG_PARAM_COUNT; } - php_stream_from_zval(stream, arg1); + php_stream_from_zval_no_verify(stream, arg1); + if (stream == NULL) { + /* we want false return value, rather than NULL */ + goto exit_failed; + } if (argc == 1) { /* ask streams to give us a buffer of an appropriate size */