mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
take into accound end \0 in decimal_string_size
This commit is contained in:
parent
9aa4871c0d
commit
e981c83610
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue