From e8c1e2ff4ca3db7f03413958fd56b5d0783714c7 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 26 Feb 2010 14:24:57 +0000 Subject: users/14897: extra test in strftime builtin for time conversion --- Src/Modules/datetime.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Src/Modules') 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); -- cgit 1.4.1