diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-03-02 17:21:42 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-03-02 17:21:42 +0000 |
| commit | cd59570c180e34a6716c2d61a3047ac2f9407795 (patch) | |
| tree | b497c0ef940ed1c5c5bed2fa08b87e03d81b7924 /strftime.c | |
| parent | 0d46d875e60091694abe5d38e0cbb4c8019bfd71 (diff) | |
Diffstat (limited to 'strftime.c')
| -rw-r--r-- | strftime.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/strftime.c b/strftime.c index 487a5234cbc5..c249010561d1 100644 --- a/strftime.c +++ b/strftime.c @@ -49,8 +49,9 @@ and account for the tm_year origin (1900) and time_t origin (1970). */ #define MKTIME_FITS_IN(min, max) \ ((min) < 0 \ - && ((min) + 0x7fffffff) / 366 / 24 / 60 / 60 / 2 + 1970 - 1900 < INT_MIN \ - && INT_MAX < ((max) - 0x7fffffff) / 366 / 24 / 60 / 60 / 2 + 1970 - 1900) + && (((min) + TWO_31_MINUS_1) / 366 / 24 / 60 / 60 / 2 + 1970 - 1900 \ + < INT_MIN) \ + && INT_MAX < ((max) - TWO_31_MINUS_1) / 366 / 24 / 60 / 60 / 2 + 1970 - 1900) /* MKTIME_MIGHT_OVERFLOW is true if mktime can fail due to time_t overflow or if it is not known whether mktime can fail, |
