diff options
-rw-r--r-- | lib/libc/stdtime/strptime.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index f69847a..21a47f7 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -518,12 +518,13 @@ strptime(const char * __restrict buf, const char * __restrict fmt, struct tm * __restrict tm) { char *ret; + time_t t; int gmt; gmt = 0; ret = _strptime(buf, fmt, tm, &gmt); - if (ret && gmt) { - time_t t = timegm(tm); + if (ret) { + t = gmt ? timegm(tm) : mktime(tm); localtime_r(&t, tm); } |