From 1a6ee38c5271f7c7da52d8758e8b91912ef9587b Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 5 Dec 2002 19:54:47 +0000 Subject: Do not guarantee an overflow of tm_year when doing the binary search in localtime/mktime/tmcomp and friends on ia64. Approved by: re --- lib/libc/stdtime/localtime.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c index c044274..a82256e 100644 --- a/lib/libc/stdtime/localtime.c +++ b/lib/libc/stdtime/localtime.c @@ -1476,6 +1476,12 @@ int * const okayp; */ bits = TYPE_BIT(time_t) - 1; /* + ** If we have more than this, we will overflow tm_year for tmcomp(). + ** We should really return an error if we cannot represent it. + */ + if (bits > 56) + bits = 56; + /* ** If time_t is signed, then 0 is just above the median, ** assuming two's complement arithmetic. ** If time_t is unsigned, then (1 << bits) is just above the median. -- cgit v1.1