diff options
Diffstat (limited to 'ext/standard/file.c')
| -rw-r--r-- | ext/standard/file.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c index eee56700d5..2540c3113e 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -128,10 +128,8 @@ php_file_globals file_globals; /* }}} */ #define PHP_STREAM_TO_ZVAL(stream, arg) \ - php_stream_from_zval_no_verify(stream, arg); \ - if (stream == NULL) { \ - RETURN_FALSE; \ - } + ZEND_ASSERT(Z_TYPE_P(arg) == IS_RESOURCE); \ + php_stream_from_res(stream, Z_RES_P(arg)); /* {{{ ZTS-stuff / Globals / Prototypes */ @@ -1157,7 +1155,7 @@ PHPAPI PHP_FUNCTION(fgetss) Implements a mostly ANSI compatible fscanf() */ PHP_FUNCTION(fscanf) { - int result, type, argc = 0; + int result, argc = 0; size_t format_len; zval *args = NULL; zval *file_handle; @@ -1169,7 +1167,7 @@ PHP_FUNCTION(fscanf) return; } - what = zend_fetch_resource(file_handle, -1, "File-Handle", &type, 2, php_file_le_stream(), php_file_le_pstream()); + what = zend_fetch_resource2(Z_RES_P(file_handle), "File-Handle", php_file_le_stream(), php_file_le_pstream()); /* we can't do a ZEND_VERIFY_RESOURCE(what), otherwise we end up * with a leak if we have an invalid filehandle. This needs changing |
