From 25c50cd193d89ad0737219142bab191f12b8abe8 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 31 Aug 2006 10:30:33 +0000 Subject: * 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 --- ext/openssl/ossl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/openssl/ossl.c') diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c index a98f2641cc..4000e8fc58 100644 --- a/ext/openssl/ossl.c +++ b/ext/openssl/ossl.c @@ -131,7 +131,7 @@ ossl_buf2str(char *buf, int len) int status = 0; str = rb_protect((VALUE(*)_((VALUE)))ossl_str_new, len, &status); - if(!NIL_P(str)) memcpy(RSTRING(str)->ptr, buf, len); + if(!NIL_P(str)) memcpy(RSTRING_PTR(str), buf, len); OPENSSL_free(buf); if(status) rb_jump_tag(status); @@ -170,7 +170,7 @@ ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd) rflag = flag ? Qtrue : Qfalse; pass = rb_protect(ossl_pem_passwd_cb0, rflag, &status); if (status) return -1; /* exception was raised. */ - len = RSTRING(pass)->len; + len = RSTRING_LEN(pass); if (len < 4) { /* 4 is OpenSSL hardcoded limit */ rb_warning("password must be longer than 4 bytes"); continue; @@ -179,7 +179,7 @@ ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd) rb_warning("password must be shorter then %d bytes", max_len-1); continue; } - memcpy(buf, RSTRING(pass)->ptr, len); + memcpy(buf, RSTRING_PTR(pass), len); break; } return len; -- cgit v1.2.3