mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00
* 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
This commit is contained in:
parent
395ca33bff
commit
bdb357e0d2
5 changed files with 11 additions and 11 deletions
4
struct.c
4
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue