diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-04-23 15:41:23 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-04-23 15:41:23 +0000 |
commit | fd190e0dcb020a3b48a68d25cedadaba2ea5e0d0 (patch) | |
tree | 0c414bcc231b383e931e5c76733cc4eba6e12667 /src/get_str.c | |
parent | fdb30f386a2964930e865387ce55b207a64b2d2d (diff) | |
download | mpfr-fd190e0dcb020a3b48a68d25cedadaba2ea5e0d0.tar.gz |
[src/get_str.c] Fixed bug in mpfr_get_str_ndigits introduced in r14494.
Note: the issue (an uninitialized variable) was detected by GCC 6.5.0;
recent GCC versions miss the -Wmaybe-uninitialized warning.
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14496 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/get_str.c')
-rw-r--r-- | src/get_str.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/get_str.c b/src/get_str.c index e37821957..e8b18385a 100644 --- a/src/get_str.c +++ b/src/get_str.c @@ -2526,7 +2526,9 @@ mpfr_get_str_ndigits (int b, mpfr_prec_t p) integer, and thus Ziv's loop will terminate. */ mpfr_prec_t w = 77; /* mpfr_ceil_mul used a 77-bit upper approximation to log(2)/log(b) */ - do + + ret = 0; + while (ret == 0) { mpfr_t d, u; @@ -2555,7 +2557,6 @@ mpfr_get_str_ndigits (int b, mpfr_prec_t p) mpfr_clear (d); mpfr_clear (u); } - while (ret == 0); } MPFR_SAVE_EXPO_FREE (expo); |