From 55544141b859e3c640c52ce962727c5419a2fa6b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 5 Apr 2002 16:53:00 +0000 Subject: Update. 2002-04-05 Jakub Jelinek * time/mktime.c (__mktime_internal): Move check for year < 70 below all variable declarations. 2002-04-04 Andreas Schwab * sysdeps/unix/sysv/linux/ia64/pipe.S: Don't overwrite r8 on error. * sysdeps/unix/sysv/linux/x86_64/time.c: Removed. * sysdeps/mips/dec/bits/endian.h: Removed since arch is not supported. --- time/mktime.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'time') diff --git a/time/mktime.c b/time/mktime.c index 101c197..5632f14 100644 --- a/time/mktime.c +++ b/time/mktime.c @@ -246,10 +246,6 @@ __mktime_internal (struct tm *tp, int mon_years = mon / 12 - negative_mon_remainder; int year = year_requested + mon_years; - /* Only years after 1970 are defined. */ - if (year < 70) - return -1; - /* The other values need not be in range: the remaining code handles minor overflows correctly, assuming int and time_t arithmetic wraps around. @@ -262,6 +258,11 @@ __mktime_internal (struct tm *tp, + mday - 1); int sec_requested = sec; + + /* Only years after 1970 are defined. */ + if (year < 70) + return -1; + #if LEAP_SECONDS_POSSIBLE /* Handle out-of-range seconds specially, since ydhms_tm_diff assumes every minute has 60 seconds. */ -- cgit v1.1