From 2be1ae5415f3087b662ac9ba6f84bb82db59c0d2 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 22 Jan 2008 01:34:24 +0000 Subject: [PATCH] use new param parsing API --- ext/standard/string.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 17ebd14f84..e232d5c1eb 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2601,18 +2601,16 @@ PHP_FUNCTION(ord) Converts ASCII code to a character */ PHP_FUNCTION(chr) { - zval **num; + long c; char temp[2]; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &c) == FAILURE) { + return; } - convert_to_long_ex(num); - - temp[0] = (char) Z_LVAL_PP(num); - temp[1] = 0; + temp[0] = (char)c; + temp[1] = '\0'; - RETVAL_STRINGL(temp, 1, 1); + RETURN_STRINGL(temp, 1, 1); } /* }}} */ -- 2.50.1