From 40bf459d45afa3388e8d9253bebe1616164936fb Mon Sep 17 00:00:00 2001 From: Arthur David Olson Date: Thu, 14 Oct 2004 18:09:03 -0400 Subject: [PATCH] account for possibility of two positives SCCS-file: zdump.c SCCS-SID: 7.46 --- zdump.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zdump.c b/zdump.c index 4da9f8c..533fcaa 100644 --- a/zdump.c +++ b/zdump.c @@ -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;