From acdf52b56e35257177df4224d423934ce5d01ac1 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 19 Jul 2005 14:59:01 +0000 Subject: * error.c (syserr_initialize): add 1 byte for snprintf() size for NUL at the end. [ruby-dev:26574] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index cfd90f8e9..f802f0784 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); -- cgit