]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__mktime_internal): Move check for year < 70 below all variable declarations.
authorUlrich Drepper <drepper@redhat.com>
Fri, 5 Apr 2002 16:43:58 +0000 (16:43 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 5 Apr 2002 16:43:58 +0000 (16:43 +0000)
time/mktime.c

index 50ab06aba852a53c379a88970017d22622dca544..470c5f5f46e995ad9a5f5da4544a278d99831f09 100644 (file)
@@ -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.  */