Skip to main content

c_str_to_bytes

Function c_str_to_bytes 

Source
pub unsafe fn c_str_to_bytes<'a>(ptr: *const c_char) -> Option<&'a [u8]>
Expand description

Convert a C string pointer to a byte slice (NULL-safe).

ยงSAFETY

  • ptr must be a valid null-terminated C string or NULL.