diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-11-12 09:10:22 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-11-12 09:10:22 +0000 |
commit | 3dce84ad075142822bd777ffd80e707ec2e9780d (patch) | |
tree | d9567bcacc9afcb87fa1105ffb1b14246e5cf01e /newlib/libc/stdlib/strtod.c | |
parent | 9de862718c69bc4b4bad96705b1df2b21e98fcdb (diff) | |
download | cygnal-3dce84ad075142822bd777ffd80e707ec2e9780d.tar.gz cygnal-3dce84ad075142822bd777ffd80e707ec2e9780d.tar.bz2 cygnal-3dce84ad075142822bd777ffd80e707ec2e9780d.zip |
* libc/stdlib/strtod.c (sulp): Cast to int32_t to avoid overflow.
* libc/time/gmtime_r.c (DAYS_PER_*_YEARS): Convert to long constants
to avoid overflow.
Diffstat (limited to 'newlib/libc/stdlib/strtod.c')
-rw-r--r-- | newlib/libc/stdlib/strtod.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c index f7cae78f7..9b064f4a8 100644 --- a/newlib/libc/stdlib/strtod.c +++ b/newlib/libc/stdlib/strtod.c @@ -163,7 +163,7 @@ _DEFUN (sulp, (x, scale), rv = ulp(dval(x)); if (!scale || (i = 2*P + 1 - ((dword0(x) & Exp_mask) >> Exp_shift)) <= 0) return rv; /* Is there an example where i <= 0 ? */ - dword0(u) = Exp_1 + (i << Exp_shift); + dword0(u) = Exp_1 + ((__int32_t)i << Exp_shift); #ifndef _DOUBLE_IS_32BITS dword1(u) = 0; #endif |