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.
This commit is contained in:
Ms2ger 2016-03-18 15:44:47 +01:00
parent ade90bf004
commit 6d043b3700
1 changed files with 2 additions and 2 deletions

View File

@ -823,8 +823,8 @@ impl <'a> SslCipher<'a> {
pub fn description(&self) -> Option<String> { pub fn description(&self) -> Option<String> {
unsafe { unsafe {
// SSL_CIPHER_description requires a buffer of at least 128 bytes. // SSL_CIPHER_description requires a buffer of at least 128 bytes.
let mut buf = [0i8; 128]; let mut buf = [0; 128];
let desc_ptr = ffi::SSL_CIPHER_description(self.cipher, &mut buf[0], 128); let desc_ptr = ffi::SSL_CIPHER_description(self.cipher, buf.as_mut_ptr(), 128);
if !desc_ptr.is_null() { if !desc_ptr.is_null() {
String::from_utf8(CStr::from_ptr(desc_ptr).to_bytes().to_vec()).ok() String::from_utf8(CStr::from_ptr(desc_ptr).to_bytes().to_vec()).ok()