diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 3aeb2e7..5b44958 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,7 +49,8 @@ fn main() { .array_chunks::<4>() .map(|bytes| u32::from_be_bytes(bytes)) // Subtract expected as we're supposed to compute it with that blanked - .fold(0u32, |a,b| a.overflowing_add(b).0) - exp_checksum; + .fold(0u32, |a,b| a.overflowing_add(b).0) + .overflowing_sub(exp_checksum).0; if file_data.len() % 4 != 0 { panic!("Invalid checksum: Uneven number of bytes"); |