diff options
author | Luke Channings <luke@channings.me> | 2021-12-17 09:42:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-17 10:42:45 +0100 |
commit | e5a8588370e01f80a3375aa3396449d8e3f648b7 (patch) | |
tree | c95c34f84f800c8f615722fe90de8c746b7b8557 | |
parent | e133d37e376edc5bc4dee74b3edb666441ff81c3 (diff) |
fix(ext/ffi): use `c_char` instead of `i8` for reading strings (#13118)
-rw-r--r-- | ext/ffi/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index de4ff3ef2..d42dddc0a 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -23,6 +23,7 @@ use std::cell::RefCell; use std::collections::HashMap; use std::ffi::c_void; use std::ffi::CStr; +use std::os::raw::c_char; use std::path::Path; use std::path::PathBuf; use std::ptr; @@ -608,7 +609,7 @@ where let permissions = state.borrow_mut::<FP>(); permissions.check(None)?; - let ptr = u64::from(ptr) as *const i8; + let ptr = u64::from(ptr) as *const c_char; Ok(unsafe { CStr::from_ptr(ptr) }.to_str()?.to_string()) } |