summaryrefslogtreecommitdiff
path: root/ext/calendar
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-06-07 09:07:36 +0000
committerAntony Dovgal <tony2001@php.net>2007-06-07 09:07:36 +0000
commit074b58b7f1ed52850c96f603e318e6496b82442e (patch)
tree24c1a5aaa1b5a3b3aa3275b5bc3347a1ef5a9a27 /ext/calendar
parentd042fd067569aac8970428629309d9b1110bbbcc (diff)
downloadphp-git-074b58b7f1ed52850c96f603e318e6496b82442e.tar.gz
MFH: php_localtime_r() checks
Diffstat (limited to 'ext/calendar')
-rw-r--r--ext/calendar/easter.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c
index 6329986e4a..ed28931ae0 100644
--- a/ext/calendar/easter.c
+++ b/ext/calendar/easter.c
@@ -36,10 +36,14 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
/* Default to the current year if year parameter is not given */
{
time_t a;
- struct tm b;
+ struct tm b, *res;
time(&a);
- php_localtime_r(&a, &b);
- year = 1900 + b.tm_year;
+ res = php_localtime_r(&a, &b);
+ if (!res) {
+ year = 1900;
+ } else {
+ year = 1900 + b.tm_year;
+ }
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,