summaryrefslogtreecommitdiff
path: root/include/decimal.h
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-11-03 22:30:37 +0100
committerunknown <serg@serg.mylan>2004-11-03 22:30:37 +0100
commite981c836104675533a2eb6810f7c1606377b0491 (patch)
treee4b9d1bf364bd3197a0b13ed5fa7aa7ad4d57d7c /include/decimal.h
parent9aa4871c0dfe23aa885f29d6775429b295073d8e (diff)
downloadmariadb-git-e981c836104675533a2eb6810f7c1606377b0491.tar.gz
take into accound end \0 in decimal_string_size
Diffstat (limited to 'include/decimal.h')
-rw-r--r--include/decimal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/decimal.h b/include/decimal.h
index dd10cee991c..5b5b8c0b460 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -70,10 +70,10 @@ int decimal_round(decimal *from, decimal *to, int new_scale, decimal_round_mode
/*
returns the length of the buffer to hold string representation
- of the decimal
+ of the decimal (including decimal dot, possible sign and \0)
*/
-#define decimal_string_size(dec) ((dec)->intg + (dec)->frac + ((dec)->frac > 0) + 1)
+#define decimal_string_size(dec) ((dec)->intg + (dec)->frac + ((dec)->frac > 0) + 2)
/* negate a decimal */
#define decimal_neg(dec) do { (dec)->sign^=1; } while(0)