mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge duplicate code blocks
This makes the code less error-prone.
This commit is contained in:
@@ -696,19 +696,7 @@ static zend_ulong zend_ini_parse_quantity_internal(zend_string *value, zend_ini_
|
||||
return 0;
|
||||
}
|
||||
digits += 2;
|
||||
if (UNEXPECTED(digits == str_end)) {
|
||||
/* Escape the string to avoid null bytes and to make non-printable chars
|
||||
* visible */
|
||||
smart_str_append_escaped(&invalid, ZSTR_VAL(value), ZSTR_LEN(value));
|
||||
smart_str_0(&invalid);
|
||||
|
||||
*errstr = zend_strpprintf(0, "Invalid quantity \"%s\": no digits after base prefix, interpreting as \"0\" for backwards compatibility",
|
||||
ZSTR_VAL(invalid.s));
|
||||
|
||||
smart_str_free(&invalid);
|
||||
return 0;
|
||||
}
|
||||
if (UNEXPECTED(digits != zend_ini_consume_quantity_prefix(digits, str_end))) {
|
||||
if (UNEXPECTED(digits == str_end || digits != zend_ini_consume_quantity_prefix(digits, str_end))) {
|
||||
/* Escape the string to avoid null bytes and to make non-printable chars
|
||||
* visible */
|
||||
smart_str_append_escaped(&invalid, ZSTR_VAL(value), ZSTR_LEN(value));
|
||||
|
||||
Reference in New Issue
Block a user