diff options
author | serg@serg.mylan <> | 2004-11-03 22:30:37 +0100 |
---|---|---|
committer | serg@serg.mylan <> | 2004-11-03 22:30:37 +0100 |
commit | b2dd380beb303592d3504824cfdd69fa724aee0e (patch) | |
tree | e4b9d1bf364bd3197a0b13ed5fa7aa7ad4d57d7c /include/decimal.h | |
parent | 9dfea75b3ed857548ba57edef9639150059820d5 (diff) | |
download | mariadb-git-b2dd380beb303592d3504824cfdd69fa724aee0e.tar.gz |
take into accound end \0 in decimal_string_size
Diffstat (limited to 'include/decimal.h')
-rw-r--r-- | include/decimal.h | 4 |
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) |