diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-14 15:57:53 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-14 15:57:53 +0300 |
commit | 3fc38ff001d5a4345def6ce960918612ed209518 (patch) | |
tree | 9fe04e4cabd32d77e8826e295240cdecb42ef3e9 | |
parent | a830a63718f1e9a0a812e772bef6e891668afd17 (diff) | |
download | egawk-3fc38ff001d5a4345def6ce960918612ed209518.tar.gz egawk-3fc38ff001d5a4345def6ce960918612ed209518.tar.bz2 egawk-3fc38ff001d5a4345def6ce960918612ed209518.zip |
Another bug fix in strftime.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | builtin.c | 3 |
2 files changed, 6 insertions, 0 deletions
@@ -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 <glaudistong@gmail.com>. + + 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. @@ -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 (;;) { |