diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-08-31 10:30:33 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-08-31 10:30:33 +0000 |
commit | 25c50cd193d89ad0737219142bab191f12b8abe8 (patch) | |
tree | a14ada29405880c7f56c615067b6600815f54334 /ext/openssl/ossl_digest.c | |
parent | 22f249ebd7a142faacdf5edd7e196bd2149feae5 (diff) | |
download | ruby-25c50cd193d89ad0737219142bab191f12b8abe8.tar.gz |
* ruby.h (struct RString): embed small strings.
(RSTRING_LEN): defined for accessing string members.
(RSTRING_PTR): ditto.
* string.c: use RSTRING_LEN and RSTRING_PTR.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_digest.c')
-rw-r--r-- | ext/openssl/ossl_digest.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/openssl/ossl_digest.c b/ext/openssl/ossl_digest.c index d22f022442..09eadc9c9c 100644 --- a/ext/openssl/ossl_digest.c +++ b/ext/openssl/ossl_digest.c @@ -136,7 +136,7 @@ ossl_digest_update(VALUE self, VALUE data) StringValue(data); GetDigest(self, ctx); - EVP_DigestUpdate(ctx, RSTRING(data)->ptr, RSTRING(data)->len); + EVP_DigestUpdate(ctx, RSTRING_PTR(data), RSTRING_LEN(data)); return self; } @@ -225,12 +225,12 @@ ossl_digest_equal(VALUE self, VALUE other) str2 = other; } GetDigest(self, ctx); - if (RSTRING(str2)->len == EVP_MD_CTX_size(ctx)) { + if (RSTRING_LEN(str2) == EVP_MD_CTX_size(ctx)) { str1 = ossl_digest_digest(self); } else { str1 = ossl_digest_hexdigest(self); } - if (RSTRING(str1)->len == RSTRING(str2)->len + if (RSTRING_LEN(str1) == RSTRING_LEN(str2) && rb_str_cmp(str1, str2) == 0) { return Qtrue; } |