mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
bigdecimal.c: expand buffer
* ext/bigdecimal/bigdecimal.c (BigMath_s_log): expand buffer size for 64bit platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b89a88f043
commit
2b1c47dadc
1 changed files with 2 additions and 2 deletions
|
@ -2919,8 +2919,8 @@ get_vp_value:
|
|||
RB_GC_GUARD(vn) = SSIZET2NUM(n);
|
||||
expo = VpExponent10(vx);
|
||||
if (expo < 0 || expo >= 3) {
|
||||
char buf[16];
|
||||
snprintf(buf, 16, "1E%"PRIdVALUE, -expo);
|
||||
char buf[SIZEOF_VALUE * CHAR_BIT / 3 + 4];
|
||||
snprintf(buf, sizeof(buf), "1E%"PRIdVALUE, -expo);
|
||||
x = BigDecimal_mult2(x, ToValue(VpCreateRbObject(1, buf)), vn);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Reference in a new issue