summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2003-04-30 10:25:57 +0000
committermtm <mtm@FreeBSD.org>2003-04-30 10:25:57 +0000
commit2819db74bce2144f1146f86204ee2670453c2a31 (patch)
tree624c574ede0ed2c62f0f0a1b79f5edd2d6cc14fe /lib/libc
parent592c5992f5d6443d9025c0270d6cdb6dae9bb5c6 (diff)
downloadFreeBSD-src-2819db74bce2144f1146f86204ee2670453c2a31.zip
FreeBSD-src-2819db74bce2144f1146f86204ee2670453c2a31.tar.gz
Backout my changes in rev. 1.32 and 1.33. There is some code that depends
on the previous behaviour. This also brings strptime(3) behaviour back in line with the other BSDs. Approved by: markm (mentor)
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdtime/strptime.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index becdd95..f69847a 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);
}
OpenPOWER on IntegriCloud