summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>1996-01-09 07:59:54 +0000
committertg <tg@FreeBSD.org>1996-01-09 07:59:54 +0000
commitc88d15f81203db949a1a1cc24297054d3936e292 (patch)
tree3da59a796f58d18a4b2ad7087737c9bc316c9e27 /usr.sbin
parentf2b0a5b11b52ba6d5abb15d7646323d296a36e27 (diff)
downloadFreeBSD-src-c88d15f81203db949a1a1cc24297054d3936e292.zip
FreeBSD-src-c88d15f81203db949a1a1cc24297054d3936e292.tar.gz
Second attempt to correct the leap year handling.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/xntpd/parse/parse.c3
1 files changed, 2 insertions, 1 deletions
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)
OpenPOWER on IntegriCloud