summaryrefslogtreecommitdiff
path: root/usr.sbin/user
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2008-12-16 05:25:56 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2008-12-16 05:25:56 +0000
commit799c9944fa8bbbc14aab0bb61b58d2823678bc31 (patch)
tree226ae8f3eeff652669f20255e87725ae857a6a49 /usr.sbin/user
parent4459921cc677485f424b3c0900bf2d409722e716 (diff)
strptime() never sets tm_isdst, so set it to -1 before passing the
struct tm to mktime() so that the calculation will follow the local DST rules ok millert@ otto@
Diffstat (limited to 'usr.sbin/user')
-rw-r--r--usr.sbin/user/user.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c
index 34397055e70..712e6c2c28a 100644
--- a/usr.sbin/user/user.c
+++ b/usr.sbin/user/user.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: user.c,v 1.73 2008/10/09 21:10:08 miod Exp $ */
+/* $OpenBSD: user.c,v 1.74 2008/12/16 05:25:55 guenther Exp $ */
/* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */
/*
@@ -911,6 +911,7 @@ scantime(time_t *tp, char *s)
*tp = 0;
if (s != NULL) {
(void) memset(&tm, 0, sizeof(tm));
+ tm.tm_isdst = -1;
if (strptime(s, "%c", &tm) != NULL) {
*tp = mktime(&tm);
} else if (strptime(s, "%B %d %Y", &tm) != NULL) {