diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-05-22 09:17:51 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-05-22 09:17:51 +0000 |
commit | 8dac76c3a64062bc0b598d5d47c4cc74353b84ca (patch) | |
tree | 40af5e26061074674c832fde9f2833e1f01b886d | |
parent | 715eed074a8dc2f33ef09816189f56536a07736a (diff) | |
download | mpfr-8dac76c3a64062bc0b598d5d47c4cc74353b84ca.tar.gz |
[src/vasprintf.c] Fixed the bug in the da_DK locale test: the
computation of the number of characters to be written was incorrect
in partition_number() when the thousands separator was not empty.
This bug was visible with size = 0 and could be visible near overflow
on the number of characters.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11513 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/vasprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vasprintf.c b/src/vasprintf.c index e709ee07c..075279418 100644 --- a/src/vasprintf.c +++ b/src/vasprintf.c @@ -1828,7 +1828,7 @@ partition_number (struct number_parts *np, mpfr_srcptr p, if (np->thousands_sep) /* ' flag, style f and the thousands separator in current locale is not reduced to the null character */ - total += (np->ip_size + np->ip_trailing_zeros) / 3; + total += (np->ip_size + np->ip_trailing_zeros - 1) / 3; if (MPFR_UNLIKELY (total < 0 || total > INT_MAX)) goto error; if (np->point) |