use &[c_char] instead of &[i8] in c_char_arr_to_string
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
use std::{
|
use std::{
|
||||||
|
ffi::c_char,
|
||||||
os::windows::process::CommandExt,
|
os::windows::process::CommandExt,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
process::Command,
|
process::Command,
|
||||||
@@ -112,7 +113,7 @@ fn get_exe_full_path(process_entry: &PROCESSENTRY32) -> Option<PathBuf> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn c_char_arr_to_string(arr: &[i8]) -> String {
|
fn c_char_arr_to_string(arr: &[c_char]) -> String {
|
||||||
arr.iter()
|
arr.iter()
|
||||||
.take_while(|&&b| b != 0)
|
.take_while(|&&b| b != 0)
|
||||||
.map(|&b| b as u8 as char)
|
.map(|&b| b as u8 as char)
|
||||||
|
|||||||
Reference in New Issue
Block a user