mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
fix(ext/ffi): use c_char
instead of i8
for reading strings (#13118)
This commit is contained in:
parent
e133d37e37
commit
e5a8588370
1 changed files with 2 additions and 1 deletions
|
@ -23,6 +23,7 @@ use std::cell::RefCell;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
|
use std::os::raw::c_char;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
@ -608,7 +609,7 @@ where
|
||||||
let permissions = state.borrow_mut::<FP>();
|
let permissions = state.borrow_mut::<FP>();
|
||||||
permissions.check(None)?;
|
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())
|
Ok(unsafe { CStr::from_ptr(ptr) }.to_str()?.to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue