diff options
author | nobu <nobu@ruby-lang.org> | 2015-08-15 04:32:15 +0000 |
---|---|---|
committer | nobu <nobu@ruby-lang.org> | 2015-08-15 04:32:15 +0000 |
commit | 83c37b2674090d59425a57a1dce5143107d569c1 (patch) | |
tree | 3fd7df98cf58ebe7dae83a6f4d29b605967da8c2 | |
parent | e9b3faecc69cab31c89e557ea4199e8791e69ef0 (diff) | |
download | ruby-openssl-history-83c37b2674090d59425a57a1dce5143107d569c1.tar.gz |
use rb_sym2str
* ext/openssl/ossl_ssl.c (ossl_sslctx_set_ssl_version): use
rb_sym2str to get rid of inadvertent ID creations.
* ext/socket/ancdata.c (ancillary_inspect): ditto.
* ext/socket/option.c (sockopt_inspect): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ext/openssl/ossl_ssl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 881057f..eaa3dfa 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -174,13 +174,13 @@ ossl_sslctx_set_ssl_version(VALUE self, VALUE ssl_method) { SSL_METHOD *method = NULL; const char *s; + VALUE m = ssl_method; int i; SSL_CTX *ctx; if (RB_TYPE_P(ssl_method, T_SYMBOL)) - s = rb_id2name(SYM2ID(ssl_method)); - else - s = StringValuePtr(ssl_method); + m = rb_sym2str(ssl_method); + s = StringValuePtr(m); for (i = 0; i < numberof(ossl_ssl_method_tab); i++) { if (strcmp(ossl_ssl_method_tab[i].name, s) == 0) { method = ossl_ssl_method_tab[i].func(); |