fix incomplete condition

This commit is contained in:
jan 2024-12-18 16:44:05 -08:00
parent b049f70dce
commit a1e9a3f90c

View File

@ -25,7 +25,7 @@ pub fn incomplete<O>(input: &[u8], size: Option<usize>) -> IResult<O> {
pub fn take_bytes<CC: Into<usize>>(input: &[u8], count: CC) -> IResult<&[u8]> { pub fn take_bytes<CC: Into<usize>>(input: &[u8], count: CC) -> IResult<&[u8]> {
let cc = count.into(); let cc = count.into();
if input.len() > cc { if input.len() < cc {
incomplete(input, Some(cc)) incomplete(input, Some(cc))
} else { } else {
let (taken, input) = input.split_at(cc); let (taken, input) = input.split_at(cc);