diff options
Diffstat (limited to 'lib/libc/stdtime/localtime.c')
-rw-r--r-- | lib/libc/stdtime/localtime.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c index 92541c5..eaee232 100644 --- a/lib/libc/stdtime/localtime.c +++ b/lib/libc/stdtime/localtime.c @@ -1449,7 +1449,9 @@ int * const okayp; } if (increment_overflow(&yourtm.tm_year, -TM_YEAR_BASE)) return WRONG; - if (yourtm.tm_year + TM_YEAR_BASE < EPOCH_YEAR) { + if (yourtm.tm_sec >= 0 && yourtm.tm_sec < SECSPERMIN) + saved_seconds = 0; + else if (yourtm.tm_year + TM_YEAR_BASE < EPOCH_YEAR) { /* ** We can't set tm_sec to 0, because that might push the ** time below the minimum representable time. |