Skip to content

Commit

Permalink
fix it correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyterkat committed May 9, 2024
1 parent 83ae193 commit bce69ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/byondapi-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ pub unsafe fn parse_args(
argc: byondapi_sys::u4c,
argv: *mut ByondValue,
) -> &'static mut [ByondValue] {
//oh fuck off
if argv.is_null() {
return &[];
return unsafe {
std::slice::from_raw_parts_mut(std::ptr::NonNull::<ByondValue>::dangling().as_ptr(), 0)
};
}
unsafe { std::slice::from_raw_parts_mut(argv, argc as usize) }
}
Expand Down

0 comments on commit bce69ae

Please sign in to comment.