diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2019-05-10 20:24:59 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2019-05-10 20:24:59 +0000 |
commit | 3856dbe4ffb5626f02e4599dd228332979b6b9e8 (patch) | |
tree | d955329f3b933dc9c779a0cc7c70418ffc9e5f14 | |
parent | 4fe10ec4ec044375f721764e522e1d5e83833b14 (diff) |
repair %Z: write seconds into tm_gmtoff, not hours;
patch from Hiltjo Posthuma <hiltjo at codemadness dot org>;
OK tedu@ millert@
-rw-r--r-- | lib/libc/time/strptime.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/time/strptime.c b/lib/libc/time/strptime.c index d2e24578008..fff2e1ae179 100644 --- a/lib/libc/time/strptime.c +++ b/lib/libc/time/strptime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strptime.c,v 1.26 2019/05/10 12:49:16 schwarze Exp $ */ +/* $OpenBSD: strptime.c,v 1.27 2019/05/10 20:24:58 schwarze Exp $ */ /* $NetBSD: strptime.c,v 1.12 1998/01/20 21:39:40 mycroft Exp $ */ /*- * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc. @@ -497,7 +497,7 @@ literal: ep = _find_string(bp, &i, nast, NULL, 4); if (ep != NULL) { #ifdef TM_GMTOFF - tm->TM_GMTOFF = -5 - i; + tm->TM_GMTOFF = (-5 - i) * SECSPERHOUR; #endif #ifdef TM_ZONE tm->TM_ZONE = (char *)nast[i]; @@ -509,7 +509,7 @@ literal: if (ep != NULL) { tm->tm_isdst = 1; #ifdef TM_GMTOFF - tm->TM_GMTOFF = -4 - i; + tm->TM_GMTOFF = (-4 - i) * SECSPERHOUR; #endif #ifdef TM_ZONE tm->TM_ZONE = (char *)nadt[i]; |