From: Ilia Alshanetsky Date: Wed, 23 May 2007 15:01:00 +0000 (+0000) Subject: Simplify code X-Git-Tag: php-5.2.3RC1~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f694fab9a0c7e232be40e909a7560c228c9a304;p=php Simplify code --- diff --git a/ext/standard/math.c b/ext/standard/math.c index d14697eb40..012889fca8 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -880,9 +880,7 @@ PHP_FUNCTION(decbin) convert_to_long_ex(arg); result = _php_math_longtobase(*arg, 2); - Z_TYPE_P(return_value) = IS_STRING; - Z_STRLEN_P(return_value) = strlen(result); - Z_STRVAL_P(return_value) = result; + RETURN_STRING(result, 0); } /* }}} */ @@ -900,9 +898,7 @@ PHP_FUNCTION(decoct) convert_to_long_ex(arg); result = _php_math_longtobase(*arg, 8); - Z_TYPE_P(return_value) = IS_STRING; - Z_STRLEN_P(return_value) = strlen(result); - Z_STRVAL_P(return_value) = result; + RETURN_STRING(result, 0); } /* }}} */ @@ -920,9 +916,7 @@ PHP_FUNCTION(dechex) convert_to_long_ex(arg); result = _php_math_longtobase(*arg, 16); - Z_TYPE_P(return_value) = IS_STRING; - Z_STRLEN_P(return_value) = strlen(result); - Z_STRVAL_P(return_value) = result; + RETURN_STRING(result, 0); } /* }}} */