From: Ian Jackson Date: Tue, 3 Aug 2021 18:44:45 +0000 (+0100) Subject: checkn: skip empty containers X-Git-Tag: hippotat/1.0.0~368 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=044aec2c2a79141b87114c42ca1da50f893d63ff;p=hippotat.git checkn: skip empty containers Signed-off-by: Ian Jackson --- diff --git a/src/slip.rs b/src/slip.rs index ad6254d..452634e 100644 --- a/src/slip.rs +++ b/src/slip.rs @@ -35,7 +35,8 @@ pub fn checkn( AC: Fn(&[u8]) -> Result<(), PacketError> + Copy, EH: FnMut(PacketError), { -// eprintln!("before: {:?}", DumpHex(data)); + // eprintln!("before: {:?}", DumpHex(data)); + if data.is_empty() { return } for packet in data.split(|&c| c == SLIP_END) { match check1(mime, mtu, packet, addr_chk) { Err(e) => error_handler(e),