(__mktime_internal): If year is 69, don't bail out early, but check whether it

overflowed afterwards.
This commit is contained in:
Ulrich Drepper 2002-04-15 06:24:31 +00:00
parent 2160bafc81
commit 370846959e

View File

@ -259,8 +259,10 @@ __mktime_internal (struct tm *tp,
int sec_requested = sec;
/* Only years after 1970 are defined. */
if (year < 70)
/* Only years after 1970 are defined.
If year is 69, it might still be representable due to
timezone differnces. */
if (year < 69)
return -1;
#if LEAP_SECONDS_POSSIBLE
@ -370,6 +372,14 @@ __mktime_internal (struct tm *tp,
return -1;
}
if (year == 69)
{
/* If year was 69, need to check whether the time was representable
or not. */
if (t < 0 || t > 2 * 24 * 60 * 60)
return -1;
}
*tp = tm;
return t;
}