diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-03 10:33:57 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-03 10:33:57 +0000 |
commit | 8984ef470547d0cb510a8937ae4b4f878f9eaba6 (patch) | |
tree | 0484a75503626586044280085984219331b978f6 /ext/dl/cfunc.c | |
parent | 7336f32c3b42e36f496972b73fd56f0205804dcb (diff) | |
download | ruby-8984ef470547d0cb510a8937ae4b4f878f9eaba6.tar.gz |
* ext/dl/cfunc.c (rb_dlcfunc_inspect): suppress warnings by
rb_sprintf.
* ext/dl/cptr.c (rb_dlptr_s_malloc): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/cfunc.c')
-rw-r--r-- | ext/dl/cfunc.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c index b123b50d24..38ff2cb8b1 100644 --- a/ext/dl/cfunc.c +++ b/ext/dl/cfunc.c @@ -284,25 +284,15 @@ rb_dlcfunc_set_ptr(VALUE self, VALUE addr) static VALUE rb_dlcfunc_inspect(VALUE self) { - VALUE val; - char *str; - int str_size; struct cfunc_data *cfunc; TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc); - str_size = (cfunc->name ? strlen(cfunc->name) : 0) + 100; - str = ruby_xmalloc(str_size); - snprintf(str, str_size - 1, - "#<DL::CFunc:%p ptr=%p type=%d name='%s'>", + return rb_sprintf("#<DL::CFunc:%p ptr=%p type=%d name='%s'>", cfunc, cfunc->ptr, cfunc->type, cfunc->name ? cfunc->name : ""); - val = rb_tainted_str_new2(str); - ruby_xfree(str); - - return val; } |