1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-12-06 16:03:57 +00:00

overflow check

SCCS-file: zic.c
SCCS-SID: 7.111
This commit is contained in:
Arthur David Olson
2003-09-16 07:12:31 -04:00
committed by Paul Eggert
parent 2b1a872425
commit ce27b2ae9a

11
zic.c
View File

@ -1155,14 +1155,11 @@ const int nfields;
error(_("time before zero"));
return;
}
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) {
error(_("time overflow"));
return;
}
tod = gethms(fields[LP_TIME], _("invalid time of day"), FALSE);
cp = fields[LP_CORR];
{