about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-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);