From c1ff4ff5c1a4b4a685c0171576ba14979b85cf9f Mon Sep 17 00:00:00 2001 From: Arthur David Olson Date: Tue, 16 Sep 2003 07:13:44 -0400 Subject: [PATCH] more overflow work SCCS-file: zic.c SCCS-SID: 7.112 --- zic.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/zic.c b/zic.c index 53de1fd..5ea99da 100644 --- a/zic.c +++ b/zic.c @@ -2139,12 +2139,11 @@ register const int wantedy; } if (dayoff < 0 && !TYPE_SIGNED(time_t)) return min_time; + if (dayoff < min_time / SECSPERDAY) + return min_time; + if (dayoff > max_time / SECSPERDAY) + return max_time; t = (time_t) dayoff * SECSPERDAY; - /* - ** Cheap overflow check. - */ - if (t / SECSPERDAY != dayoff) - return (dayoff > 0) ? max_time : min_time; return tadd(t, rp->r_tod); }