summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-19 13:53:23 +0000
committerwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-19 13:53:23 +0000
commit9c3ecf6fbfa694edfcad48417b7fb5f5e85a737b (patch)
treec86190be333f5f8a7e6e1bf86f3cf0ef387e2ae7 /util.c
parentb4f5ab964737d16791634b96a4b2cf2007effa16 (diff)
Backport #1232. Fixed sprintf buffer corruption.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@24583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index af6e689d0a..13c86eaf18 100644
--- a/util.c
+++ b/util.c
@@ -3403,7 +3403,7 @@ dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
if (i <= 0)
i = 1;
}
- s = s0 = rv_alloc(i);
+ s = s0 = rv_alloc(i+1);
#ifdef Honor_FLT_ROUNDS
if (mode > 1 && rounding != 1)