diff options
author | Tom Cosgrove <tom@cvs.openbsd.org> | 2004-08-18 19:13:08 +0000 |
---|---|---|
committer | Tom Cosgrove <tom@cvs.openbsd.org> | 2004-08-18 19:13:08 +0000 |
commit | e2199ed6ff86f59b30f871e76e03df82a7ea1f91 (patch) | |
tree | 639042663b6769f654ba87956f1354019f6a31a1 /sys | |
parent | 0f110bcb2ab1876b57c9052cf1be0de616ee188d (diff) |
Calculate time_t correctly from (day, month, year): 1/1/70 is 0, not 1,
as recently fixed on i386.
requested by, and ok, deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/stand/libsa/time.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/amd64/stand/libsa/time.c b/sys/arch/amd64/stand/libsa/time.c index e79698f1fac..04917cff10a 100644 --- a/sys/arch/amd64/stand/libsa/time.c +++ b/sys/arch/amd64/stand/libsa/time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: time.c,v 1.1 2004/02/03 12:09:47 mickey Exp $ */ +/* $OpenBSD: time.c,v 1.2 2004/08/18 19:13:07 tom Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -62,7 +62,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--) |