summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand/libsa
diff options
context:
space:
mode:
authorTom Cosgrove <tom@cvs.openbsd.org>2004-08-17 15:11:32 +0000
committerTom Cosgrove <tom@cvs.openbsd.org>2004-08-17 15:11:32 +0000
commit99759626b3d6caa76c6f860601e231c3b58cdffd (patch)
tree9780ed15fee85a0a66867ed5be910cff8b41be3a /sys/arch/i386/stand/libsa
parent74da1cca5790f08d58e696596b0857d3ab3c7aa3 (diff)
Calculate time_t correctly from (day, month, year): 1/1/70 is 0, not 1.
ok deraadt@
Diffstat (limited to 'sys/arch/i386/stand/libsa')
-rw-r--r--sys/arch/i386/stand/libsa/time.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/i386/stand/libsa/time.c b/sys/arch/i386/stand/libsa/time.c
index fe6096a7e6d..eca29d3c6ac 100644
--- a/sys/arch/i386/stand/libsa/time.c
+++ b/sys/arch/i386/stand/libsa/time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.c,v 1.15 2004/03/09 19:12:13 tom Exp $ */
+/* $OpenBSD: time.c,v 1.16 2004/08/17 15:11:31 tom Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -61,7 +61,7 @@ compute(int year, u_int8_t month, u_int8_t day, u_int8_t hour,
register time_t tt;
/* Compute days */
- tt = (year - 1970) * 365 + monthcount[month] + day;
+ tt = (year - 1970) * 365 + monthcount[month] + day - 1;
/* Compute for leap year */
for (month <= 2 ? year-- : 0; year >= 1970; year--)