Fix compile failed in stable/beta

master
hh9527 8 years ago committed by GitHub
parent 2bace2ca0d
commit 51dd656272
  1. 2
      src/ffi_util.rs

@ -18,7 +18,7 @@ use std::ffi::CStr;
pub fn error_message(ptr: *const c_char) -> String {
let cstr = unsafe { CStr::from_ptr(ptr as *const _) };
let s = String::from_utf8_lossy(cstr.to_bytes()).into();
let s = String::from_utf8_lossy(cstr.to_bytes()).into_owned();
unsafe {
libc::free(ptr as *mut c_void);
}

Loading…
Cancel
Save