aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-07-25 00:49:30 +0000
committerUlrich Drepper <drepper@redhat.com>2003-07-25 00:49:30 +0000
commit02ade8d6b0058becfb8d3156e8b9cc3519bfb4bb (patch)
tree8350ce4d253038074572b480fb12a177e5aa5617
parent99fe3b0e7a0a9d72152cc86df0571c231c83cae4 (diff)
downloadglibc-02ade8d6b0058becfb8d3156e8b9cc3519bfb4bb.zip
glibc-02ade8d6b0058becfb8d3156e8b9cc3519bfb4bb.tar.gz
glibc-02ade8d6b0058becfb8d3156e8b9cc3519bfb4bb.tar.bz2
Update.
* timezone/zic.c (rpytime): Replace cheap overflow check with a functioning one.
-rw-r--r--ChangeLog3
-rw-r--r--timezone/zic.c11
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index c96f699..44e8d63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2003-07-24 Ulrich Drepper <drepper@redhat.com>
+ * timezone/zic.c (rpytime): Replace cheap overflow check with a
+ functioning one.
+
* include/link.h (struct link_map): Add l_tls_firstbyte_offset field.
* sysdeps/generic/dl-tls.c [TLS_TCB_AT_TP] (_dl_determine_tlsoffset):
Fix calculation of offsets to take misalignment of first byte in
diff --git a/timezone/zic.c b/timezone/zic.c
index 64642b3..26d0041 100644
--- a/timezone/zic.c
+++ b/timezone/zic.c
@@ -2152,12 +2152,13 @@ register const int wantedy;
}
if (dayoff < 0 && !TYPE_SIGNED(time_t))
return min_time;
+ if (dayoff < min_time / SECSPERDAY)
+ return min_time;
+ if (dayoff > max_time / SECSPERDAY)
+ return max_time;
t = (time_t) dayoff * SECSPERDAY;
- /*
- ** Cheap overflow check.
- */
- if (t / SECSPERDAY != dayoff)
- return (dayoff > 0) ? max_time : min_time;
+ if (t > 0 && max_time - t < rp->r_tod)
+ return max_time;
return tadd(t, rp->r_tod);
}