Skip to content

Commit 730a781

Browse files
tomterlbd808
authored andcommitted
Fix #75: Handle zndocs/ndocs correctly
Just changing the handling, that is param handling of ndocs and dtor call for zndocs, in yaml_parse_file to that in yaml_parse. That fixes #75 for me.
1 parent e7bffc0 commit 730a781

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yaml.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ PHP_FUNCTION(yaml_parse_file)
407407
YAML_G(timestamp_decoder) = NULL;
408408

409409
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
410-
"s|lza/", &filename, &filename_len, &pos, &zndocs,
410+
"s|lz/a/", &filename, &filename_len, &pos, &zndocs,
411411
&zcallbacks)) {
412412
return;
413413
}
@@ -451,7 +451,7 @@ PHP_FUNCTION(yaml_parse_file)
451451

452452
if (zndocs != NULL) {
453453
/* copy document count to var user sent in */
454-
zval_dtor(zndocs);
454+
zval_ptr_dtor(zndocs);
455455
ZVAL_LONG(zndocs, ndocs);
456456
}
457457

0 commit comments

Comments
 (0)