diff --git a/ffi/src/logging.rs b/ffi/src/logging.rs index 404d873..3b93159 100644 --- a/ffi/src/logging.rs +++ b/ffi/src/logging.rs @@ -1,7 +1,7 @@ // Jackson Coxson use std::{ - ffi::{CString, c_char}, + ffi::{CStr, CString, c_char}, fs::File, }; @@ -46,7 +46,7 @@ pub unsafe extern "C" fn idevice_init_logger( )); if !file_path.is_null() { - let file_path = match unsafe { CString::from_raw(file_path) }.to_str() { + let file_path = match unsafe { CStr::from_ptr(file_path) }.to_str() { Ok(f) => f.to_string(), Err(_) => { return IdeviceLoggerError::InvalidPathString;