summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index cfd90f8e95..f802f07842 100644
--- a/eval.c
+++ b/eval.c
@@ -8510,13 +8510,13 @@ proc_to_s(self)
if ((node = data->frame.node) || (node = data->body)) {
len += strlen(node->nd_file) + 2 + (SIZEOF_LONG*CHAR_BIT-NODE_LSHIFT)/3;
str = rb_str_new(0, len);
- snprintf(RSTRING(str)->ptr, len,
+ snprintf(RSTRING(str)->ptr, len+1,
"#<%s:0x%.*lx@%s:%d>", cname, w, (VALUE)data->body,
node->nd_file, nd_line(node));
}
else {
str = rb_str_new(0, len);
- snprintf(RSTRING(str)->ptr, len,
+ snprintf(RSTRING(str)->ptr, len+1,
"#<%s:0x%.*lx>", cname, w, (VALUE)data->body);
}
RSTRING(str)->len = strlen(RSTRING(str)->ptr);