diff options
author | Stanislav Malyshev <stas@php.net> | 2007-09-20 22:35:24 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2007-09-20 22:35:24 +0000 |
commit | 7985002fc694ee6dcca628cbf83a9cc6b546e7ab (patch) | |
tree | f1215790821e2b2227b4f00e8c30ad3de6a4f70d /ext | |
parent | fa0efe45e0540c756c7f5f16e724f65313fbec2e (diff) | |
download | php-git-7985002fc694ee6dcca628cbf83a9cc6b546e7ab.tar.gz |
better fix for iconv_substr
Diffstat (limited to 'ext')
-rw-r--r-- | ext/iconv/iconv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 52b95e186d..2aca0b5cc0 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -700,7 +700,12 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval, } } - if (offset >= total_len || len > total_len) { + if(len > total_len) { + len = total_len; + } + + + if (offset >= total_len) { return PHP_ICONV_ERR_SUCCESS; } |