From 421a7651aa8ff0ad7045cdaf41023adbf6307e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Mon, 13 Feb 2023 16:07:38 +0000 Subject: [PATCH] posix: fix misuse of bool (invalid code in c23) a bool pointer argument cannot take true or false but either &boolval or NULL --- ext/posix/posix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 505493ec2f68f..35a99af923ec6 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -458,7 +458,7 @@ PHP_FUNCTION(posix_ttyname) RETURN_FALSE; } } else { - if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ false, /* check_null */ false, /* arg_num */ 1)) { + if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) { php_error_docref(NULL, E_WARNING, "Argument #1 ($file_descriptor) must be of type int|resource, %s given", zend_zval_value_name(z_fd)); fd = zval_get_long(z_fd); @@ -508,7 +508,7 @@ PHP_FUNCTION(posix_isatty) RETURN_FALSE; } } else { - if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ false, /* check_null */ false, /* arg_num */ 1)) { + if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) { php_error_docref(NULL, E_WARNING, "Argument #1 ($file_descriptor) must be of type int|resource, %s given", zend_zval_value_name(z_fd)); fd = zval_get_long(z_fd); @@ -1242,7 +1242,7 @@ PHP_FUNCTION(posix_fpathconf) RETURN_FALSE; } } else { - if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ false, /* check_null */ false, /* arg_num */ 1)) { + if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) { zend_argument_type_error(1, "must be of type int|resource, %s given", zend_zval_value_name(z_fd)); RETURN_THROWS();