From f54af75eb7f8c861383119722f548cb2866ca813 Mon Sep 17 00:00:00 2001 From: Ondrej Perutka Date: Mon, 30 Nov 2015 21:06:54 +0100 Subject: Cast correctly c_char raw pointers (fixes build on ARM #314) --- openssl/src/ssl/error.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'openssl/src/ssl/error.rs') 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() } } -- cgit v1.2.3