Skip to content

Commit

Permalink
Merge pull request #41 from jam1garner/master
Browse files Browse the repository at this point in the history
Fix mutability issue with free changes
  • Loading branch information
jam1garner authored Jan 3, 2021
2 parents 72e5999 + 65d7482 commit 47f3f6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use skyline::libc::free;
#[repr(C)]
pub struct ShowKeyboardArg {
pub keyboard_config: [u8; 0x4D0],
pub work_buffer: *const c_void,
pub work_buffer: *mut c_void,
pub work_buffer_size: usize,
pub text_buffer: *const c_void,
pub text_buffer_size: usize,
Expand Down Expand Up @@ -59,7 +59,7 @@ impl ShowKeyboardArg {

let work_buffer_size = 0xd000;
let work_buffer: Box<[u8; 0xd000]> = unsafe { Box::new_zeroed().assume_init() };
let work_buffer = Box::leak(work_buffer) as *const _ as *const c_void;
let work_buffer = Box::leak(work_buffer) as *mut _ as *mut c_void;

arg.work_buffer = work_buffer;
arg.work_buffer_size = work_buffer_size;
Expand Down

0 comments on commit 47f3f6c

Please sign in to comment.