better fix for iconv_substr

This commit is contained in:
Stanislav Malyshev 2007-09-20 22:38:25 +00:00
parent c891118ce9
commit 39253a5418

View File

@ -765,7 +765,11 @@ 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;
}