summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-01-16 06:35:40 +0000
committerache <ache@FreeBSD.org>1996-01-16 06:35:40 +0000
commit957026871dc93227f02df598d02760c149e78d24 (patch)
tree31922081dd99bffd0647e81219cb879e881889cf /sys/isa
parentad0738fce47baa54c0c44140dae71b46c95ed816 (diff)
downloadFreeBSD-src-957026871dc93227f02df598d02760c149e78d24.zip
FreeBSD-src-957026871dc93227f02df598d02760c149e78d24.tar.gz
Since new bcd* macros not argument range overflow resistant,
fix argument overflow for years >= 2000
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/atrtc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c
index a6d2aca..a2dd215 100644
--- a/sys/isa/atrtc.c
+++ b/sys/isa/atrtc.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.48 1996/01/15 21:12:50 phk Exp $
+ * $Id: clock.c,v 1.49 1996/01/15 21:26:43 phk Exp $
*/
/*
@@ -524,11 +524,9 @@ resettodr()
tm -= m;
/* Now we have the years in y and the day-of-the-year in tm */
-#ifdef USE_RTC_CENTURY
writertc(RTC_YEAR, bin2bcd(y%100)); /* Write back Year */
+#ifdef USE_RTC_CENTURY
writertc(RTC_CENTURY, bin2bcd(y/100)); /* ... and Century */
-#else
- writertc(RTC_YEAR, bin2bcd(y - 1900)); /* Write back Year */
#endif
for (m = 0; ; m++) {
int ml;
OpenPOWER on IntegriCloud