Skip to content

Commit

Permalink
Use more efficient Cstr technique
Browse files Browse the repository at this point in the history
  • Loading branch information
notgull committed Apr 1, 2023
1 parent 0c1d33f commit 861f847
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion android-activity/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ pub(crate) fn abort_on_panic<R>(f: impl FnOnce() -> R) -> R {
} else {
let unknown_panic =
unsafe { CStr::from_bytes_with_nul_unchecked(b"UnknownPanic\0") };
android_log(Level::Error, unknown_panic, &CString::new("").unwrap());
android_log(Level::Error, unknown_panic, unsafe {
CStr::from_bytes_with_nul_unchecked(b"\0")
});
}

std::process::abort();
Expand Down

0 comments on commit 861f847

Please sign in to comment.