minor changes in iconv_substr() to avoid zval converting

This commit is contained in:
Antony Dovgal 2006-08-31 11:17:37 +00:00
parent 73fbbb48ec
commit 32ff2a16fe

View File

@ -1886,7 +1886,6 @@ PHP_FUNCTION(iconv_substr)
char *str;
int str_len;
long offset, length;
zval *len_z = NULL;
php_iconv_err_t err;
@ -1894,17 +1893,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);