From 622f45fccb5ebfdf684bb8428203307aa8d0cb89 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 4 May 2010 03:39:36 +0000 Subject: [PATCH] * ext/socket/option.c (sockopt_inspect): use rb_str_cat2 and rb_str_append. * ext/socket/ancdata.c (ancillary_inspect): refined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ ext/socket/ancdata.c | 3 +-- ext/socket/option.c | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b4781a2f7..209c68ad99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue May 4 12:38:40 2010 Tanaka Akira + + * ext/socket/option.c (sockopt_inspect): use rb_str_cat2 and + rb_str_append. + + * ext/socket/ancdata.c (ancillary_inspect): refined. + Tue May 4 11:48:06 2010 Tanaka Akira * ext/socket/ancdata.c (ancillary_inspect): use rb_str_cat2 and diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 9e93b0457e..880f79cf17 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -1066,9 +1066,8 @@ ancillary_inspect(VALUE self) } if (!inspected) { - data = rb_str_dump(data); rb_str_cat2(ret, " "); - rb_str_append(ret, data); + rb_str_append(ret, rb_str_dump(data)); } rb_str_cat2(ret, ">"); diff --git a/ext/socket/option.c b/ext/socket/option.c index 23afbe21d5..63bffb9f68 100644 --- a/ext/socket/option.c +++ b/ext/socket/option.c @@ -633,8 +633,8 @@ sockopt_inspect(VALUE self) } if (!inspected) { - data = rb_str_dump(data); - rb_str_catf(ret, " %s", StringValueCStr(data)); + rb_str_cat2(ret, " "); + rb_str_append(ret, rb_str_dump(data)); } rb_str_cat2(ret, ">");