From 861f847861ba8bb49a30252fb614769326a1b275 Mon Sep 17 00:00:00 2001 From: jtnunley Date: Sat, 1 Apr 2023 10:13:34 -0700 Subject: [PATCH] Use more efficient Cstr technique --- android-activity/src/util.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android-activity/src/util.rs b/android-activity/src/util.rs index 94e2c1b..6184b7c 100644 --- a/android-activity/src/util.rs +++ b/android-activity/src/util.rs @@ -63,7 +63,9 @@ pub(crate) fn abort_on_panic(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();