diff options
author | Antony Dovgal <tony2001@php.net> | 2006-08-31 11:17:47 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-08-31 11:17:47 +0000 |
commit | c4e9ee25860d707c20eead453356ed09e13a649d (patch) | |
tree | 457fbdc198da10fafaa6cf18339a6dacaf093202 | |
parent | f74fbc1a0603401d7df4597f13b27309e2e7452e (diff) | |
download | php-git-c4e9ee25860d707c20eead453356ed09e13a649d.tar.gz |
minor changes in iconv_substr() to avoid zval converting
-rw-r--r-- | ext/iconv/iconv.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index a5cc9b31b0..0564b731ac 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1883,7 +1883,6 @@ PHP_FUNCTION(iconv_substr) char *str; int str_len; long offset, length; - zval *len_z = NULL; php_iconv_err_t err; @@ -1891,17 +1890,14 @@ PHP_FUNCTION(iconv_substr) charset = ICONVG(internal_encoding); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|zs", - &str, &str_len, &offset, &len_z, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls", + &str, &str_len, &offset, &length, &charset, &charset_len) == FAILURE) { RETURN_FALSE; } - if (len_z == NULL) { + if (ZEND_NUM_ARGS() < 3) { length = str_len; - } else { - convert_to_long_ex(&len_z); - length = Z_LVAL_P(len_z); } err = _php_iconv_substr(&retval, str, str_len, offset, length, charset); |