Remove always-false condition from substr_replace()

l < 0 is checked before and set to a different value.
This commit is contained in:
Niels Dossche 2023-12-11 20:08:13 +01:00
parent ea5521c68c
commit e78966386b

View File

@ -2171,7 +2171,7 @@ PHP_FUNCTION(substr_replace)
}
}
if ((size_t)l > ZSTR_LEN(str) || (l < 0 && (size_t)(-l) > ZSTR_LEN(str))) {
if ((size_t)l > ZSTR_LEN(str)) {
l = ZSTR_LEN(str);
}