aboutsummaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-04-04 05:10:14 +0000
committerUlrich Drepper <drepper@redhat.com>2002-04-04 05:10:14 +0000
commit4a10c7fec7babe4b74d070c1d5ff575ca8abe31b (patch)
tree34675dfc790492933ec70351e75438fbdd6279a8 /time
parent87c9379402f3d91373438919f77f693f59ceafe1 (diff)
downloadglibc-4a10c7fec7babe4b74d070c1d5ff575ca8abe31b.zip
glibc-4a10c7fec7babe4b74d070c1d5ff575ca8abe31b.tar.gz
glibc-4a10c7fec7babe4b74d070c1d5ff575ca8abe31b.tar.bz2
Update.
2002-04-03 Ulrich Drepper <drepper@redhat.com> * locale/programs/charmap.c (charmap_read): If the charmap doesn't define a code_set_name provide one based on the filename. * malloc/hooks.c: Define weak_variable correctly for _LIBC. 2001-12-28 Andreas Jaeger <aj@suse.de> * time/mktime.c (__mktime_internal): Check for year < 70 [PR libc/2738]. * sysdeps/generic/w_lgamma.c: Initialized local_signgam. * sysdeps/generic/w_lgammaf.c: Likewise. * sysdeps/generic/w_lgammal.c: Likewise [PR libc/2854]. * debug/catchsegv.sh (exval): Quote [ in pattern [PR libc/2902]. Adjust for new output format of the backtrace functions. * misc/syslog.c (vsyslog): Only use cleanup handler if _LIBC_REENTRANT is defined [PR libc/2924]. * sysdeps/s390/s390-64/bits/byteswap.h: Likewise [PR libc/2757].
Diffstat (limited to 'time')
-rw-r--r--time/mktime.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/time/mktime.c b/time/mktime.c
index 5f3f3f2..101c197 100644
--- a/time/mktime.c
+++ b/time/mktime.c
@@ -1,5 +1,5 @@
/* Convert a `struct tm' to a time_t value.
- Copyright (C) 1993, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1993-1999, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Eggert (eggert@twinsun.com).
@@ -246,7 +246,11 @@ __mktime_internal (struct tm *tp,
int mon_years = mon / 12 - negative_mon_remainder;
int year = year_requested + mon_years;
- /* The other values need not be in range:
+ /* 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.
Major overflows are caught at the end. */