Skip to main content

slice_at_lenient

Function slice_at_lenient 

Source
pub fn slice_at_lenient(data: &[u8], offset: usize, len: usize) -> Result<&[u8]>
Expand description

Return data[offset..] clamped to at most len bytes. Used for payloads where vendors routinely declare slightly more bytes than the file contains (truncated final strips are a common real-world quirk).