Skip to content

Commit d7da1aa

Browse files
committed
Coding style, ANSI C compatibility
1 parent a426e0b commit d7da1aa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ext/date/php_date.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
847847
}
848848
/* }}} */
849849

850-
// created this callback method to check the date.timezone only when changed, to increase performance and error on an ini_set line
850+
/* Callback to check the date.timezone only when changed increases performance */
851851
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
852852
static PHP_INI_MH(OnUpdate_date_timezone)
853853
{
@@ -872,19 +872,20 @@ static PHP_INI_MH(OnUpdate_date_timezone)
872872
static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
873873
{
874874
/* Checking configure timezone */
875-
if (DATEG(timezone) && strlen(DATEG(timezone)) > 0) {
875+
if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
876876
return DATEG(timezone);
877877
}
878878
/* Check config setting for default timezone */
879879
if (!DATEG(default_timezone)) {
880880
/* Special case: ext/date wasn't initialized yet */
881881
zval ztz;
882882

883-
if (SUCCESS == zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz) && Z_TYPE(ztz) == IS_STRING && Z_STRLEN(ztz) > 0 && timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
883+
if (SUCCESS == zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz)
884+
&& Z_TYPE(ztz) == IS_STRING && Z_STRLEN(ztz) > 0 && timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
884885
return Z_STRVAL(ztz);
885886
}
886887
} else if (*DATEG(default_timezone)) {
887-
if (DATEG(timezone_valid) == 1) { // timezone already checked and validated
888+
if (DATEG(timezone_valid) == 1) {
888889
return DATEG(default_timezone);
889890
}
890891

0 commit comments

Comments
 (0)