summaryrefslogtreecommitdiff
path: root/ext/iconv/iconv.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2016-08-30 01:18:23 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2016-08-30 01:18:59 +0200
commitec8bbba9c66072cccbc9074ea3de90499c525a13 (patch)
treede7c621a1457c892b5e04da07f50379bd70a229a /ext/iconv/iconv.c
parent2bfe926eb1ee57afb11a7872f0fcb5c4cc1e3ebc (diff)
parent4b45c0a9a7d48a69edba9e00270c49bbe17af4d1 (diff)
downloadphp-git-ec8bbba9c66072cccbc9074ea3de90499c525a13.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
Diffstat (limited to 'ext/iconv/iconv.c')
-rw-r--r--ext/iconv/iconv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 0d44936ea6..99a24d78bc 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -858,7 +858,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
}
- if ((size_t)offset >= total_len) {
+ if ((size_t)offset > total_len) {
return PHP_ICONV_ERR_SUCCESS;
}
@@ -2108,7 +2108,7 @@ PHP_FUNCTION(iconv_substr)
err = _php_iconv_substr(&retval, ZSTR_VAL(str), ZSTR_LEN(str), offset, length, charset);
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
- if (err == PHP_ICONV_ERR_SUCCESS && ZSTR_LEN(str) > 0 && retval.s != NULL) {
+ if (err == PHP_ICONV_ERR_SUCCESS && ZSTR_LEN(str) >= 0 && retval.s != NULL) {
RETURN_NEW_STR(retval.s);
}
smart_str_free(&retval);