summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/datetime.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 268e5b202..73300e602 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2010-02-26 Peter Stephenson <pws@csr.com>
+ * users/14897: Src/Modules/datetime.c: test needed on
+ conversion of time_t to struct tm. Found on 64-bit Linux.
+
* 27756: Doc/Zsh/calsys.yo, Functions/Calendar/calendar,
Functions/Calendar/calendar_add, Functions/Calendar/calendar_edit,
Functions/Calendar/calendar_sort, Src/Modules/system.c:
@@ -12835,5 +12838,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4917 $
+* $Revision: 1.4918 $
*****************************************************
diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c
index 328870eba..f1c5488ea 100644
--- a/Src/Modules/datetime.c
+++ b/Src/Modules/datetime.c
@@ -121,6 +121,10 @@ bin_strftime(char *nam, char **argv, Options ops, UNUSED(int func))
}
t = localtime(&secs);
+ if (!t) {
+ zwarnnam(nam, "%s: unable to convert to time", argv[1]);
+ return 1;
+ }
bufsize = strlen(argv[0]) * 8;
buffer = zalloc(bufsize);