Function strlen
pub fn strlen(buf: usize, len: usize) -> usize ⓘ
Available on crate feature
dep_nc
only.Expand description
Calculate the length of a string.
use nc::c_str::strlen;
let buf = &[b'h', b'e', b'l', b'l', b'o', 0];
let l = strlen(buf.as_ptr() as usize, buf.len());
assert_eq!(l, 5);