summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-19 14:59:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-19 14:59:01 +0000
commitbdb357e0d22600ba5a9e44403cef67267e24c74c (patch)
treea7f32971a56115906044c3d295d5124b9b0f9c25 /object.c
parent395ca33bffc96f0396a2160931f91d15d5ba8af1 (diff)
* error.c (syserr_initialize): add 1 byte for snprintf() size for
NUL at the end. [ruby-dev:26574] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/object.c b/object.c
index 27af5b3..b87a1d3 100644
--- a/object.c
+++ b/object.c
@@ -357,9 +357,9 @@ rb_any_to_s(obj)
size_t len;
VALUE str;
- len = strlen(cname)+6+16+1;
- str = rb_str_new(0, len); /* 6:tags 16:addr 1:nul */
- snprintf(RSTRING(str)->ptr, len, "#<%s:0x%lx>", cname, obj);
+ len = strlen(cname)+6+16;
+ str = rb_str_new(0, len); /* 6:tags 16:addr */
+ snprintf(RSTRING(str)->ptr, len+1, "#<%s:0x%lx>", cname, obj);
RSTRING(str)->len = strlen(RSTRING(str)->ptr);
if (OBJ_TAINTED(obj)) OBJ_TAINT(str);