diff options
| author | Steven Fackler <[email protected]> | 2015-11-30 15:21:59 -0500 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-11-30 15:21:59 -0500 |
| commit | 38e73ce3eb966f7b64198ea0b221a5b4ec11f202 (patch) | |
| tree | f93d4b0743351e6e8127ddd2a5b677858cdf66de /openssl/src/ssl/error.rs | |
| parent | Mention el cap changes in readme (diff) | |
| parent | Cast correctly c_char raw pointers (fixes build on ARM #314) (diff) | |
| download | rust-openssl-38e73ce3eb966f7b64198ea0b221a5b4ec11f202.tar.xz rust-openssl-38e73ce3eb966f7b64198ea0b221a5b4ec11f202.zip | |
Merge pull request #315 from operutka/master
Cast correctly c_char raw pointers (fixes build on ARM #314)
Diffstat (limited to 'openssl/src/ssl/error.rs')
| -rw-r--r-- | openssl/src/ssl/error.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/openssl/src/ssl/error.rs b/openssl/src/ssl/error.rs index 0126b277..d76494f1 100644 --- a/openssl/src/ssl/error.rs +++ b/openssl/src/ssl/error.rs @@ -117,21 +117,24 @@ pub enum OpensslError { fn get_lib(err: c_ulong) -> String { unsafe { - let bytes = CStr::from_ptr(ffi::ERR_lib_error_string(err)).to_bytes().to_vec(); + let cstr = ffi::ERR_lib_error_string(err); + let bytes = CStr::from_ptr(cstr as *const _).to_bytes().to_vec(); String::from_utf8(bytes).unwrap() } } fn get_func(err: c_ulong) -> String { unsafe { - let bytes = CStr::from_ptr(ffi::ERR_func_error_string(err)).to_bytes().to_vec(); + let cstr = ffi::ERR_func_error_string(err); + let bytes = CStr::from_ptr(cstr as *const _).to_bytes().to_vec(); String::from_utf8(bytes).unwrap() } } fn get_reason(err: c_ulong) -> String { unsafe { - let bytes = CStr::from_ptr(ffi::ERR_reason_error_string(err)).to_bytes().to_vec(); + let cstr = ffi::ERR_reason_error_string(err); + let bytes = CStr::from_ptr(cstr as *const _).to_bytes().to_vec(); String::from_utf8(bytes).unwrap() } } |