summaryrefslogtreecommitdiff
path: root/ext/recode/recode.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2001-03-08 17:11:57 +0000
committerStanislav Malyshev <stas@php.net>2001-03-08 17:11:57 +0000
commite30d8e4abf1ba05e6bdab19abe2a3a04deed43cd (patch)
treefaa48e2e0c722ddb4b6576c901fd8752902b8200 /ext/recode/recode.c
parenta4a8369f7dd295e16794f07116dcf44e5093908b (diff)
downloadphp-git-e30d8e4abf1ba05e6bdab19abe2a3a04deed43cd.tar.gz
Better use buffer_to_buffer, since zval is really buffer, not string (it can
contain \0's and not end in \0). # and recode_string is recode_buffer_to_buffer internally anyways
Diffstat (limited to 'ext/recode/recode.c')
-rw-r--r--ext/recode/recode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index 206154522e..6a6863881d 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -111,6 +111,7 @@ PHP_FUNCTION(recode_string)
pval **str;
pval **req;
bool success;
+ int r_len=0, r_alen =0;
ReSLS_FETCH();
if (ZEND_NUM_ARGS() != 2
@@ -132,13 +133,13 @@ PHP_FUNCTION(recode_string)
goto error_exit;
}
- r = recode_string(request, (*str)->value.str.val);
+ recode_buffer_to_buffer(request, Z_STRVAL_PP(str), Z_STRLEN_PP(str), &r, &r_len, &r_alen);
if (!r) {
php_error(E_WARNING, "Recoding failed.");
goto error_exit;
}
- RETVAL_STRING(r, 1);
+ RETVAL_STRINGL(r, r_len, 1);
free(r);
/* FALLTHROUGH */