summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorTatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com>2011-05-12 04:05:12 +0100
committerTatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com>2011-05-12 04:05:12 +0100
commite0c0bf323bd26c011842c7d97ab7ec5ee4b5d80d (patch)
treec05960ee2cf34663d49c4cbf04a9eb7ee6e3712a /strings/decimal.c
parent99a8398f42270ac106b8b7893b76deb0603d2b70 (diff)
parent9990ab901bbe1a99538d062d7b13c29ad84823a9 (diff)
downloadmariadb-git-e0c0bf323bd26c011842c7d97ab7ec5ee4b5d80d.tar.gz
auto-merge Bug#11762799/Bug#55436
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index e081c063033..3b72ddb82c6 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -312,8 +312,8 @@ int decimal_actual_fraction(decimal_t *from)
from - value to convert
to - points to buffer where string representation
should be stored
- *to_len - in: size of to buffer
- out: length of the actually written string
+ *to_len - in: size of to buffer (incl. terminating '\0')
+ out: length of the actually written string (excl. '\0')
fixed_precision - 0 if representation can be variable length and
fixed_decimals will not be checked in this case.
Put number as with fixed point position with this
@@ -330,6 +330,7 @@ int decimal2string(decimal_t *from, char *to, int *to_len,
int fixed_precision, int fixed_decimals,
char filler)
{
+ /* {intg_len, frac_len} output widths; {intg, frac} places in input */
int len, intg, frac= from->frac, i, intg_len, frac_len, fill;
/* number digits before decimal point */
int fixed_intg= (fixed_precision ?