Skip to content

Commit e4e1746

Browse files
committed
Remove unnecessary condition as always true.
ZSTR_LEN(str) is an unsigned integer therefor it is always greater or equal than 0. Detected by -Wtype-limits compiler warning.
1 parent c343c1b commit e4e1746

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/iconv/iconv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,7 @@ PHP_FUNCTION(iconv_substr)
20522052
err = _php_iconv_substr(&retval, ZSTR_VAL(str), ZSTR_LEN(str), offset, length, charset);
20532053
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
20542054

2055-
if (err == PHP_ICONV_ERR_SUCCESS && ZSTR_LEN(str) >= 0 && retval.s != NULL) {
2055+
if (err == PHP_ICONV_ERR_SUCCESS && retval.s != NULL) {
20562056
RETURN_NEW_STR(retval.s);
20572057
}
20582058
smart_str_free(&retval);

0 commit comments

Comments
 (0)