Skip to main content

cstr_to_str

Function cstr_to_str 

Source
pub(crate) unsafe fn cstr_to_str(ptr: *const u8) -> &'static str
Expand description

Convert a null-terminated C string pointer to a &'static str.

ยงSafety

ptr must point to a valid null-terminated byte sequence that remains valid for the lifetime of the process (true for argv pointers on the initial user stack).