MCPcopy Create free account
hub / github.com/PLSysSec/wave / first_null

Function first_null

src/tcb/misc.rs:151–156  ·  view source on GitHub ↗
(buf: &Vec<u8>, start: usize, offset: usize, len: usize)

Source from the content-addressed store, hash-verified

149#[requires(buf.len() >= start + len)]
150#[ensures(result < old(len))]
151pub fn first_null(buf: &Vec<u8>, start: usize, offset: usize, len: usize) -> usize {
152 buf[start + offset..start + len]
153 .iter()
154 .position(|x| *x == 0)
155 .unwrap()
156}
157
158#[trusted]
159// #[requires(buf.len() > start + len + 19)]

Callers 3

check_first_nullFunction · 0.85
parseMethod · 0.85
parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected