Skip to content

Commit

Permalink
Fix a panic in byond::parse_args with debug assertions (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy authored Oct 20, 2024
1 parent 9682fc0 commit 6f35136
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/byond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ thread_local! {
}

pub unsafe fn parse_args<'a>(argc: c_int, argv: *const *const c_char) -> Vec<Cow<'a, str>> {
if argc == 0 || argv.is_null() {
return Vec::new();
}
unsafe {
slice::from_raw_parts(argv, argc as usize)
.iter()
Expand Down

0 comments on commit 6f35136

Please sign in to comment.