diff --git a/gns/src/lib.rs b/gns/src/lib.rs index 476d6ff..f434704 100644 --- a/gns/src/lib.rs +++ b/gns/src/lib.rs @@ -136,7 +136,7 @@ impl GnsGlobal { GNS_INIT.store(false, std::sync::atomic::Ordering::SeqCst); Err(format!( "{}", - core::str::from_utf8_unchecked(core::mem::transmute(&error[..])) + CStr::from_ptr(error.as_ptr()).to_string_lossy() )) } else { Ok(GnsGlobal(()))