aboutsummaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-11-15 22:59:33 +0100
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2018-11-15 22:59:33 +0100
commit6c90d759f613761de7ac435bbabcc373092cf8bc (patch)
tree989124756c6321a862bf3932baf62a5bc3dd2133 /time
parentmktime: new test for mktime failure (diff)
downloadglibc-6c90d759f613761de7ac435bbabcc373092cf8bc.tar.gz
glibc-6c90d759f613761de7ac435bbabcc373092cf8bc.tar.bz2
glibc-6c90d759f613761de7ac435bbabcc373092cf8bc.zip
mktime: simplify offset guess
[BZ#23789] * time/mktime.c (__mktime_internal): Omit excess precision.
Diffstat (limited to 'time')
-rw-r--r--time/mktime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/time/mktime.c b/time/mktime.c
index 106b4eac26..0f905eb8fe 100644
--- a/time/mktime.c
+++ b/time/mktime.c
@@ -355,7 +355,7 @@ __mktime_internal (struct tm *tp,
struct tm *(*convert) (const time_t *, struct tm *),
mktime_offset_t *offset)
{
- long_int t, gt, t0, t1, t2, dt;
+ long_int t, gt, t0, t1, t2;
struct tm tm;
/* The maximum number of probes (calls to CONVERT) should be enough
@@ -502,8 +502,8 @@ __mktime_internal (struct tm *tp,
/* Set *OFFSET to the low-order bits of T - T0 - NEGATIVE_OFFSET_GUESS.
This is just a heuristic to speed up the next mktime call, and
correctness is unaffected if integer overflow occurs here. */
- INT_SUBTRACT_WRAPV (t, t0, &dt);
- INT_SUBTRACT_WRAPV (dt, negative_offset_guess, offset);
+ INT_SUBTRACT_WRAPV (t, t0, offset);
+ INT_SUBTRACT_WRAPV (*offset, negative_offset_guess, offset);
if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec)
{