Skip to main content

cstr_opt

Function cstr_opt 

Source
pub unsafe fn cstr_opt(ptr: *const c_char) -> Option<String>
Expand description

Copy an optional C string, treating null or an empty string as absent.

ยงSafety

If non-null, ptr must point to a NUL-terminated string in a single readable allocation of at most isize::MAX bytes, including the terminator. The bytes must remain valid and unchanged for this call.