account for possibility of two positives

SCCS-file: zdump.c
SCCS-SID: 7.46
This commit is contained in:
Arthur David Olson
2012-07-18 03:02:44 -04:00
committed by Paul Eggert
parent f594aead36
commit 40bf459d45
+4
View File
@@ -414,6 +414,10 @@ register const struct tm * timeptr;
#define DIVISOR 10
lead = timeptr->tm_year / DIVISOR + TM_YEAR_BASE / DIVISOR;
trail = timeptr->tm_year % DIVISOR + TM_YEAR_BASE % DIVISOR;
if (trail > DIVISOR) {
trail -= DIVISOR;
++lead;
}
while (trail < 0) {
trail += DIVISOR;
--lead;