diff options
| author | Xinchen Hui <laruence@gmail.com> | 2014-02-24 18:32:09 +0800 |
|---|---|---|
| committer | Xinchen Hui <laruence@gmail.com> | 2014-02-24 18:32:09 +0800 |
| commit | 1e5a4f281d21abab8101301ea155f9c0394ab02f (patch) | |
| tree | 22993ba5a8198516d961af221352dfb2febef425 /ext/standard/string.c | |
| parent | 5fccb0724b71e992b43ea92a4e27284c17d09063 (diff) | |
| download | php-git-1e5a4f281d21abab8101301ea155f9c0394ab02f.tar.gz | |
Refactor php_uu(en/de)code to returning zend_string
Diffstat (limited to 'ext/standard/string.c')
| -rw-r--r-- | ext/standard/string.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index be4d874b06..af3c192f10 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1344,15 +1344,15 @@ PHP_FUNCTION(strtoupper) { char *arg; int arglen; + zend_string *result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arglen) == FAILURE) { return; } - arg = estrndup(arg, arglen); - php_strtoupper(arg, arglen); -//??? RETURN_STRINGL(arg, arglen, 0); - RETURN_STRINGL(arg, arglen); + result = STR_INIT(arg, arglen, 0); + php_strtoupper(result->val, result->len); + RETURN_STR(result); } /* }}} */ @@ -1379,15 +1379,15 @@ PHP_FUNCTION(strtolower) { char *str; int arglen; + zend_string *result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &arglen) == FAILURE) { return; } - str = estrndup(str, arglen); - php_strtolower(str, arglen); -//??? RETURN_STRINGL(str, arglen, 0); - RETURN_STRINGL(str, arglen); + result = STR_INIT(str, arglen, 0); + php_strtolower(result->val, result->len); + RETURN_STR(result); } /* }}} */ |
