From: Andi Gutmans Date: Sun, 11 Jun 2000 17:23:38 +0000 (+0000) Subject: - Untested but it should fix the problem with cyr_convert() not being X-Git-Tag: php-4.0.1RC~273 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7c50e48664302977ad24e41180e1b6ff91c2bbb;p=php - Untested but it should fix the problem with cyr_convert() not being - binary safe and destroying other values in the script --- diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index c5919b58c0..921552ba55 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -202,7 +202,7 @@ _cyr_mac = { * d - x-cp866 * m - x-mac-cyrillic *****************************************************************************/ -static char * php_convert_cyr_string(unsigned char *str, char from, char to) +static char * php_convert_cyr_string(unsigned char *str, int length, char from, char to) { const unsigned char *from_table, *to_table; unsigned char tmp; @@ -259,7 +259,7 @@ static char * php_convert_cyr_string(unsigned char *str, char from, char to) if (!str) return (char *)str; - for( i = 0; str[i]; i++) + for( i = 0; ivalue.str.val; + str = (unsigned char*) estrndup((*str_arg)->value.str.val, (*str_arg)->value.str.len); - php_convert_cyr_string(str, (*fr_cs)->value.str.val[0],(*to_cs)->value.str.val[0]); - RETVAL_STRING((char *)str, 1) + php_convert_cyr_string(str, (*str_arg)->value.str.len, (*fr_cs)->value.str.val[0], (*to_cs)->value.str.val[0]); + RETVAL_STRING((char *)str, 0) } /* }}} */