From 3fc38ff001d5a4345def6ce960918612ed209518 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 14 Apr 2015 15:57:53 +0300 Subject: Another bug fix in strftime. --- ChangeLog | 3 +++ builtin.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2a99f374..6398cbfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ add check that time_t is > 0 --- means we're assigning a negative value to an unsigned time_t. Thanks again to Glaudiston Gomes da Silva . + + If localtime() or gmtime() return NULL, return a null string. + Thanks to Andrew Schorr. Unrelated: * builtin.c (call_sub): Fix for indirect gensub, 3 args now works. diff --git a/builtin.c b/builtin.c index f650a9f8..fc670946 100644 --- a/builtin.c +++ b/builtin.c @@ -1943,6 +1943,9 @@ do_strftime(int nargs) else tm = localtime(& fclock); + if (tm == NULL) + return make_string("", 0); + bufp = buf; bufsize = sizeof(buf); for (;;) { -- cgit v1.2.3