diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-10-30 14:26:03 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-10-30 14:26:03 +0000 |
commit | 0c98c821608efdd9a9014e0e9de744e215fdce31 (patch) | |
tree | d33570f4a628d0ab29302aa9f71223af74c0b625 /tests/tget_str.c | |
parent | bcaad054cf42051f9101e6f7a9fa2d88f1d1b819 (diff) | |
download | mpfr-0c98c821608efdd9a9014e0e9de744e215fdce31.tar.gz |
[tests/tget_str.c] Fixed a test that made mpfr_get_str crash with
logging (even when the base is invalid, the MPFR number must be
initialized).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9224 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tget_str.c')
-rw-r--r-- | tests/tget_str.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/tget_str.c b/tests/tget_str.c index 97d69320c..10ab25796 100644 --- a/tests/tget_str.c +++ b/tests/tget_str.c @@ -1085,6 +1085,8 @@ check_special (int b, mpfr_prec_t p) int r; size_t m; + mpfr_init2 (x, p); + /* check for invalid base */ if (mpfr_get_str (s, &e, 1, 10, x, MPFR_RNDN) != NULL) { @@ -1101,7 +1103,6 @@ check_special (int b, mpfr_prec_t p) for (i=1; i<MAX_DIGITS+2; i++) s2[i] = '0'; - mpfr_init2 (x, p); mpfr_set_ui (x, 1, MPFR_RNDN); for (i=1; i<MAX_DIGITS && mpfr_mul_ui (x, x, b, MPFR_RNDN) == 0; i++) { |