diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-22 15:34:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-22 15:34:23 +0000 |
commit | 6c0f54029816b7df0ce67b78f0dbe382546953da (patch) | |
tree | 8f0564d72b69d73c44db04e177637f64bdee5b21 /ext/openssl/ossl_x509req.c | |
parent | d56885b43df3b4e9e67fc4a39cbaaaea6961d5d8 (diff) | |
download | ruby-6c0f54029816b7df0ce67b78f0dbe382546953da.tar.gz |
* ext/openssl: suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_x509req.c')
-rw-r--r-- | ext/openssl/ossl_x509req.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/openssl/ossl_x509req.c b/ext/openssl/ossl_x509req.c index 13a42dddaf..7c1b610159 100644 --- a/ext/openssl/ossl_x509req.c +++ b/ext/openssl/ossl_x509req.c @@ -99,7 +99,7 @@ static VALUE ossl_x509req_initialize(int argc, VALUE *argv, VALUE self) { BIO *in; - X509_REQ *req; + X509_REQ *req, *x = DATA_PTR(self); VALUE arg; if (rb_scan_args(argc, argv, "01", &arg) == 0) { @@ -107,10 +107,12 @@ ossl_x509req_initialize(int argc, VALUE *argv, VALUE self) } arg = ossl_to_der_if_possible(arg); in = ossl_obj2bio(arg); - req = PEM_read_bio_X509_REQ(in, (X509_REQ **)&DATA_PTR(self), NULL, NULL); + req = PEM_read_bio_X509_REQ(in, &x, NULL, NULL); + DATA_PTR(self) = x; if (!req) { - BIO_reset(in); - req = d2i_X509_REQ_bio(in, (X509_REQ **)&DATA_PTR(self)); + (void)BIO_reset(in); + req = d2i_X509_REQ_bio(in, &x); + DATA_PTR(self) = x; } BIO_free(in); if (!req) ossl_raise(eX509ReqError, NULL); @@ -171,7 +173,7 @@ ossl_x509req_to_der(VALUE self) if ((len = i2d_X509_REQ(req, NULL)) <= 0) ossl_raise(eX509CertError, NULL); str = rb_str_new(0, len); - p = RSTRING_PTR(str); + p = (unsigned char *)RSTRING_PTR(str); if (i2d_X509_REQ(req, &p) <= 0) ossl_raise(eX509ReqError, NULL); ossl_str_adjust(str, p); |