summaryrefslogtreecommitdiff
path: root/ext/standard/datetime.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/datetime.c')
-rw-r--r--ext/standard/datetime.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index dd1ae7cbe..afb5e771d 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: datetime.c,v 1.134.2.2.2.3 2007/01/01 09:36:08 sebastian Exp $ */
+/* $Id: datetime.c,v 1.134.2.2.2.4 2007/06/07 08:59:00 tony2001 Exp $ */
#include "php.h"
#include "zend_operators.h"
@@ -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],