From 6d043b3700676246b46a3df7f791695b9abc169d Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 18 Mar 2016 15:44:47 +0100 Subject: [PATCH] Allow Rust to infer the type of the argument to SSL_CIPHER_description. This allows the code to compile on Android, where an unsigned char is expected. --- openssl/src/ssl/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 574a324b..38527dc6 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -823,8 +823,8 @@ impl <'a> SslCipher<'a> { pub fn description(&self) -> Option { unsafe { // SSL_CIPHER_description requires a buffer of at least 128 bytes. - let mut buf = [0i8; 128]; - let desc_ptr = ffi::SSL_CIPHER_description(self.cipher, &mut buf[0], 128); + let mut buf = [0; 128]; + let desc_ptr = ffi::SSL_CIPHER_description(self.cipher, buf.as_mut_ptr(), 128); if !desc_ptr.is_null() { String::from_utf8(CStr::from_ptr(desc_ptr).to_bytes().to_vec()).ok()