From 08d984d7e45ed294e4a621545b38af8b84489047 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 25 Oct 2024 23:13:43 +0200 Subject: [PATCH] fix(gns): init error is cstr --- gns/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(()))