Fix redundant ZSTR_VAL condition in php_date.c (#8753)

ZSTR_VAL can never be NULL as zend_string.val is a char[1] which will
always decay to a non-nullable pointer.

This fails with -Werror on newer gcc versions.
This commit is contained in:
Ilija Tovilo 2022-06-12 10:59:37 +02:00 committed by GitHub
parent 3f7ec69b61
commit e79046fbe4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -477,7 +477,7 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(const char *formal_tzname, const t
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */ /* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
static PHP_INI_MH(OnUpdate_date_timezone) static PHP_INI_MH(OnUpdate_date_timezone)
{ {
if (new_value && ZSTR_VAL(new_value) && !timelib_timezone_id_is_valid(ZSTR_VAL(new_value), DATE_TIMEZONEDB)) { if (new_value && !timelib_timezone_id_is_valid(ZSTR_VAL(new_value), DATE_TIMEZONEDB)) {
php_error_docref( php_error_docref(
NULL, E_WARNING, NULL, E_WARNING,
"Invalid date.timezone value '%s', using '%s' instead", "Invalid date.timezone value '%s', using '%s' instead",