From d671849b7fe59a2e7be29772770e2b6f4d27dfa8 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 8 Mar 2025 15:24:55 +0100 Subject: [PATCH] uucore: set the unsafe at the right place --- src/uucore/src/lib/features/entries.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uucore/src/lib/features/entries.rs b/src/uucore/src/lib/features/entries.rs index af20891d0..b7d732630 100644 --- a/src/uucore/src/lib/features/entries.rs +++ b/src/uucore/src/lib/features/entries.rs @@ -164,11 +164,11 @@ pub struct Passwd { /// ptr must point to a valid C string. /// /// Returns None if ptr is null. -unsafe fn cstr2string(ptr: *const c_char) -> Option { +fn cstr2string(ptr: *const c_char) -> Option { if ptr.is_null() { None } else { - Some(CStr::from_ptr(ptr).to_string_lossy().into_owned()) + Some(unsafe { CStr::from_ptr(ptr).to_string_lossy().into_owned() }) } }