summaryrefslogtreecommitdiff
path: root/struct.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 /struct.c
parent395ca33bffc96f0396a2160931f91d15d5ba8af1 (diff)
downloadruby-bdb357e0d22600ba5a9e44403cef67267e24c74c.tar.gz
* 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 'struct.c')
-rw-r--r--struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/struct.c b/struct.c
index ed3f9f28ee..15546b981d 100644
--- a/struct.c
+++ b/struct.c
@@ -518,10 +518,10 @@ rb_struct_inspect(s)
{
if (rb_inspecting_p(s)) {
char *cname = rb_class2name(rb_obj_class(s));
- size_t len = strlen(cname) + 15;
+ size_t len = strlen(cname) + 14;
VALUE str = rb_str_new(0, len);
- snprintf(RSTRING(str)->ptr, len, "#<struct %s:...>", cname);
+ snprintf(RSTRING(str)->ptr, len+1, "#<struct %s:...>", cname);
RSTRING(str)->len = strlen(RSTRING(str)->ptr);
return str;
}