From c88d15f81203db949a1a1cc24297054d3936e292 Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 9 Jan 1996 07:59:54 +0000 Subject: Second attempt to correct the leap year handling. --- usr.sbin/xntpd/parse/parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.sbin/xntpd') diff --git a/usr.sbin/xntpd/parse/parse.c b/usr.sbin/xntpd/parse/parse.c index a5fd9f1..11dacd9 100644 --- a/usr.sbin/xntpd/parse/parse.c +++ b/usr.sbin/xntpd/parse/parse.c @@ -642,7 +642,8 @@ parse_to_unixtime(clock, cvtrtc) */ t = (clock->year - 1970) * 365; t += (clock->year >> 2) - (1970 >> 2); - t -= clock->year / 400 - 1970 / 400; + t -= clock->year / 100 - 1970 / 100; + t += clock->year / 400 - 1970 / 400; /* month */ if (clock->month <= 0 || clock->month > 12) -- cgit v1.1