Skip to content

Commit

Permalink
fix(gns): init error is cstr
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-aitlahcen committed Oct 25, 2024
1 parent 4349fff commit c4c2c8a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gns/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ impl GnsGlobal {
let mut error: SteamDatagramErrMsg = MaybeUninit::zeroed().assume_init();
if !GameNetworkingSockets_Init(core::ptr::null(), &mut error) {
GNS_INIT.store(false, std::sync::atomic::Ordering::SeqCst);
Err(format!(
"{}",
core::str::from_utf8_unchecked(core::mem::transmute(&error[..]))
))
Err(format!("{}", CStr::from_ptr(error.as_ptr())))
} else {
Ok(GnsGlobal(()))
}
Expand Down

0 comments on commit c4c2c8a

Please sign in to comment.