diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2002-09-03 04:34:10 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2002-09-03 04:34:10 +0000 |
| commit | b331ec93c042d4656995c2d647b4957548a2b303 (patch) | |
| tree | d0ac221786ea37c1b0d16321e110d967a03fe09d /lib/libc/stdtime | |
| parent | 162e98939f15bb95c4b8ffda5e4fcd79d560026f (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdtime')
| -rw-r--r-- | lib/libc/stdtime/localtime.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c index 3531aa481b72..f37f3329488c 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; /* + * Limit to 32 bits or the things go crazy + * when it tries to figure out times near 2^62 etc. + */ + if (bits > 31) + bits = 31; + /* ** 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. |
