From e2199ed6ff86f59b30f871e76e03df82a7ea1f91 Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Wed, 18 Aug 2004 19:13:08 +0000 Subject: 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@ --- sys/arch/amd64/stand/libsa/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/arch/amd64/stand') 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--) -- cgit v1.2.3