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.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ext/openssl/ossl.h') diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h index 0366901a35..3be563005c 100644 --- a/ext/openssl/ossl.h +++ b/ext/openssl/ossl.h @@ -118,11 +118,10 @@ VALUE ossl_x509crl_sk2ary(STACK_OF(X509_CRL) *crl); VALUE ossl_buf2str(char *buf, int len); #define ossl_str_adjust(str, p) \ do{\ - int len = RSTRING(str)->len;\ - int newlen = (p) - (unsigned char*)RSTRING(str)->ptr;\ + int len = RSTRING_LEN(str);\ + int newlen = (p) - (unsigned char*)RSTRING_PTR(str);\ assert(newlen <= len);\ - RSTRING(str)->len = newlen;\ - RSTRING(str)->ptr[newlen] = 0;\ + rb_str_set_len(str, newlen);\ }while(0) /* -- cgit v1.2.3