summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-11 03:15:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-11 03:15:01 +0000
commit2b1c47dadc4a664684cb4215c7352d71275675c1 (patch)
tree4ab037549b752c2efb632d2069cc6556c1207322 /ext
parentb89a88f043b46a98821b6ccfbb94f469bf403e58 (diff)
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
Diffstat (limited to 'ext')
-rw-r--r--ext/bigdecimal/bigdecimal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 3bc516687d..c5a3326fb7 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -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 {