From 8ac1a1f31ee0131d1e5c16d2207cf4a4e50704fa Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Wed, 31 May 2023 19:27:09 +0200 Subject: [PATCH] fix issue with checking crc --- rust/client/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/client/src/main.rs b/rust/client/src/main.rs index b76d7c0..128f197 100644 --- a/rust/client/src/main.rs +++ b/rust/client/src/main.rs @@ -224,7 +224,7 @@ fn main() { let mut crc32 = crc32fast::Hasher::new(); for i in 0..packets.len() { crc32.update(&packets[i]); - if packet_hashes[i] != crc32.clone().finalize() { + if packet_hashes[i] != crc32.clone().finalize() && packet_hashes[i] != 0 { println!("Packet {} crc does not match, writing .corrupt", i); //TODO: Request packets again let mut file = std::fs::File::create("received/".to_string()+filename+".corrupt").expect("Failed to create file");