fix issue with checking crc

This commit is contained in:
Mystikfluu 2023-05-31 19:27:09 +02:00
parent 6a6b453953
commit 8ac1a1f31e

View File

@ -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");