Function strlen

pub(in ::ffi::c_str) const unsafe fn strlen(ptr: *const c_char) -> usize

Calculate the length of a nul-terminated string. Defers to C's strlen when possible.

Safety

The pointer must point to a valid buffer that contains a NUL terminator. The NUL must be located within isize::MAX from ptr.