+2000-04-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_acts.c (acts_receive): Do a better job with year
+ conversions and leap-year checks. The PTB stuff caught this.
+ Reported by: Daniel.Aeby@eam.admin.ch
+
2000-04-02 Harlan Stenn <stenn@whimsy.udel.edu>
* ntpd/refclock_atom.c (atom_pps): Bugfix
(void)write(pp->io.fd, &flag, 1);
/*
- * Yes, I know this code incorrectly thinks that 2000 is a leap
- * year. The ACTS timecode format croaks then anyway. Life is
- * short. Would only the timecode mavens resist the urge to
- * express months of the year and days of the month in favor of
- * days of the year.
- * NOTE: year 2000 IS a leap year!!! ghealton Y2KFixes
+ * The ACTS timecode format croaks in 2000. Life is short.
+ * Would only the timecode mavens resist the urge to express months
+ * of the year and days of the month in favor of days of the year.
*/
if (month < 1 || month > 12 || day < 1) {
refclock_report(peer, CEVNT_BADTIME);
return;
}
- if ( pp->year <= YEAR_PIVOT ) pp->year += 100; /* Y2KFixes */
- if ( !isleap_tm(pp->year) ) { /* Y2KFixes */
+
+ /*
+ * Depending on the driver, at this point we have a two-digit year
+ * or a four-digit year. Make sure we have a four-digit year.
+ */
+ if ( pp->year < YEAR_PIVOT ) pp->year += 100; /* Y2KFixes */
+ if ( pp->year < YEAR_BREAK ) pp->year += 1900; /* Y2KFixes */
+ if ( !isleap_4(pp->year) ) { /* Y2KFixes */
if (day > day1tab[month - 1]) {
refclock_report(peer, CEVNT_BADTIME);
return;