aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_engine.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-13 00:57:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-13 00:57:41 +0000
commit74947c9d1ee149231b34247d0f930a56f424a4c1 (patch)
tree1349fec38eb931bfe1cfb467883958255049a388 /ext/openssl/ossl_engine.c
parent5f11c4104258ab4fbb4927754de14e8ef2d5a8bd (diff)
downloadruby-74947c9d1ee149231b34247d0f930a56f424a4c1.tar.gz
ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_engine.c')
-rw-r--r--ext/openssl/ossl_engine.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/ext/openssl/ossl_engine.c b/ext/openssl/ossl_engine.c
index da1a3c7a74..f99a30dfc3 100644
--- a/ext/openssl/ossl_engine.c
+++ b/ext/openssl/ossl_engine.c
@@ -523,18 +523,11 @@ ossl_engine_get_cmds(VALUE self)
static VALUE
ossl_engine_inspect(VALUE self)
{
- VALUE str;
- const char *cname = rb_class2name(rb_obj_class(self));
-
- str = rb_str_new2("#<");
- rb_str_cat2(str, cname);
- rb_str_cat2(str, " id=\"");
- rb_str_append(str, ossl_engine_get_id(self));
- rb_str_cat2(str, "\" name=\"");
- rb_str_append(str, ossl_engine_get_name(self));
- rb_str_cat2(str, "\">");
-
- return str;
+ ENGINE *e;
+
+ GetEngine(self, e);
+ return rb_sprintf("#<%"PRIsVALUE" id=\"%s\" name=\"%s\">",
+ rb_obj_class(self), ENGINE_get_id(e), ENGINE_get_name(e));
}
#define DefEngineConst(x) rb_define_const(cEngine, #x, INT2NUM(ENGINE_##x))