openssl/ossl.h: calculate as long
* ext/openssl/ossl.h (ossl_str_adjust): calculate as long, not casting to int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
74947c9d1e
commit
23a8568739
@ -137,8 +137,8 @@ VALUE ossl_x509name_sk2ary(STACK_OF(X509_NAME) *names);
|
|||||||
VALUE ossl_buf2str(char *buf, int len);
|
VALUE ossl_buf2str(char *buf, int len);
|
||||||
#define ossl_str_adjust(str, p) \
|
#define ossl_str_adjust(str, p) \
|
||||||
do{\
|
do{\
|
||||||
int len = RSTRING_LENINT(str);\
|
long len = RSTRING_LEN(str);\
|
||||||
int newlen = rb_long2int((p) - (unsigned char*)RSTRING_PTR(str));\
|
long newlen = (long)((p) - (unsigned char*)RSTRING_PTR(str));\
|
||||||
assert(newlen <= len);\
|
assert(newlen <= len);\
|
||||||
rb_str_set_len((str), newlen);\
|
rb_str_set_len((str), newlen);\
|
||||||
}while(0)
|
}while(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user