diff options
| author | Mike Makonnen <mtm@FreeBSD.org> | 2003-04-30 10:25:57 +0000 |
|---|---|---|
| committer | Mike Makonnen <mtm@FreeBSD.org> | 2003-04-30 10:25:57 +0000 |
| commit | 6c688436bb522db4345a1d8ace437aefa0679749 (patch) | |
| tree | 624c574ede0ed2c62f0f0a1b79f5edd2d6cc14fe /lib/libc/stdtime | |
| parent | 16dbbeec744275d8d81435ad4c98a6534e987dc8 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdtime')
| -rw-r--r-- | lib/libc/stdtime/strptime.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index becdd951f7dfe..f69847a85bee8 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -518,14 +518,12 @@ strptime(const char * __restrict buf, const char * __restrict fmt, struct tm * __restrict tm) { char *ret; - time_t t; int gmt; gmt = 0; - memset((void*)tm, 0, sizeof(struct tm)); ret = _strptime(buf, fmt, tm, &gmt); - if (ret) { - t = gmt ? timegm(tm) : mktime(tm); + if (ret && gmt) { + time_t t = timegm(tm); localtime_r(&t, tm); } |
