about summary refs log tree commit diff
path: root/Src/Modules/datetime.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-02-26 14:24:57 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-02-26 14:24:57 +0000
commite8c1e2ff4ca3db7f03413958fd56b5d0783714c7 (patch)
tree51347c26d10424192371a5f15468a669b52797fa /Src/Modules/datetime.c
parent07b6256d8ea03805dd8a24c184bf455ee31d6115 (diff)
downloadzsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.tar.gz
zsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.tar.xz
zsh-e8c1e2ff4ca3db7f03413958fd56b5d0783714c7.zip
users/14897: extra test in strftime builtin for time conversion
Diffstat (limited to 'Src/Modules/datetime.c')
-rw-r--r--Src/Modules/datetime.c4
1 files changed, 4 insertions, 0 deletions
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);