summaryrefslogtreecommitdiff
path: root/ext/standard/datetime.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-06-07 08:59:00 +0000
committerAntony Dovgal <tony2001@php.net>2007-06-07 08:59:00 +0000
commitd042fd067569aac8970428629309d9b1110bbbcc (patch)
tree73feee9ae22642eb7454420018929b8dc6687462 /ext/standard/datetime.c
parentc9805e7b9240c9513c4fb6add41b004328caf463 (diff)
downloadphp-git-d042fd067569aac8970428629309d9b1110bbbcc.tar.gz
MFH: php_gmtime_r() fixes
Diffstat (limited to 'ext/standard/datetime.c')
-rw-r--r--ext/standard/datetime.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index 592e5a3523..123d080ff5 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -58,6 +58,12 @@ PHPAPI char *php_std_date(time_t t TSRMLS_DC)
tm1 = php_gmtime_r(&t, &tmbuf);
str = emalloc(81);
+ str[0] = '\0';
+
+ if (!tm1) {
+ return str;
+ }
+
if (PG(y2k_compliance)) {
snprintf(str, 80, "%s, %02d %s %04d %02d:%02d:%02d GMT",
day_short_names[tm1->tm_wday],