]> granicus.if.org Git - php/commitdiff
Fix #26772: fgets returns NULL instead of FALSE.
authorWez Furlong <wez@php.net>
Wed, 14 Jan 2004 14:25:01 +0000 (14:25 +0000)
committerWez Furlong <wez@php.net>
Wed, 14 Jan 2004 14:25:01 +0000 (14:25 +0000)
ext/standard/file.c

index 21a10cb3f0c9c00d8eb73ae0c6b1093a613c87cc..79abc8aa1ebbe2672fe31e265601fa774229a40a 100644 (file)
@@ -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 */