From ddf4322ef281fc29e45f44aebb37785ece47a06b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 23 Nov 2019 19:54:30 -0500 Subject: [PATCH] ignore result of `mktime` The result of `mktime` is -1 for an error. The result is also -1 if the time is 1 second before the epoch. That's not useful, so ignore it. original commit: aa8ca31cef223128fd8ed1abdc76beb31a0e077a --- c/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/stats.c b/c/stats.c index e254546e73..39bebd33ab 100644 --- a/c/stats.c +++ b/c/stats.c @@ -351,7 +351,7 @@ ptr S_gmtime(ptr tzoff, ptr tspair) { if (tzoff == Sfalse) { if (localtime_r(&tx, &tmx) == NULL) return Sfalse; tmx.tm_isdst = -1; /* have mktime determine the DST status */ - if (mktime(&tmx) == (time_t)-1) return Sfalse; + mktime(&tmx); (void) adjust_time_zone(dtvec, &tmx, Sfalse); } else { tx += Sinteger_value(tzoff);