Skip to content

Commit

Permalink
use platform independent c_char type over u8 or i8 to represent CStri…
Browse files Browse the repository at this point in the history
…ng pointer
  • Loading branch information
tehsmeely committed Jan 20, 2024
1 parent 5367162 commit aec0fe8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/system.rs
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ impl System {
.iter()
.map(|s| CString::new(s.clone()).map_err(|e| anyhow!("CString::new: {}", e)))
.collect::<Result<Vec<CString>, Error>>()?;
let c_options_ptrs: Vec<*const u8> = c_options.iter().map(|c| c.as_ptr()).collect();
let c_options_ptrs: Vec<*const c_char> = c_options.iter().map(|c| c.as_ptr()).collect();
let c_options_ptrs_ptr = c_options_ptrs.as_ptr();
let option_titles = c_options_ptrs_ptr as *mut *const c_char;
let wrapped_callback = Box::new(callback);

0 comments on commit aec0fe8

Please sign in to comment.