mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-03 06:15:29 +00:00
POSIX says that localtime should fail with EOVERFLOW if the result cannot be represented, which is the case for most large (in absolute value) time_t inputs, since they overflow (or underflow) tm_year, which is an int. This patch introduces this functionality. Previously, tm_year just overflowed (or underflowed) silently. Incidentally, this partially fixes #12729 without solving the root problem, which is that time_to_tm is linear in its input to determine the number of years since epoch. This means that the bash port mktime test no longer times-out in 60s, but it still fails (faster) in some other place. Due to underlying issue in the algorithm, the worst case inputs still take a couple of seconds on my machine.
14 KiB
14 KiB