From 0f0ef1dd960a5410f013160a946ac576b282fabb Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:35:55 -0700 Subject: [PATCH] chore: Fix use of a stale value in a `debug_assert_eq!` --- src/write.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/write.rs b/src/write.rs index bdbe2388..b2a821d9 100644 --- a/src/write.rs +++ b/src/write.rs @@ -957,11 +957,12 @@ impl ZipWriter { debug_assert!(pad_body.len() >= 2); [pad_body[0], pad_body[1]] = options.alignment.to_le_bytes(); extensions.add_extra_data(0xa11e, pad_body.into_boxed_slice(), false)?; - debug_assert_eq!(header_end % align, 0); } } file.extra_data_start = Some(writer.stream_position()?); writer.write_all(&extensions.extra_data)?; + header_end = writer.stream_position()?; + debug_assert_eq!(header_end % (options.alignment as u64), 0); match options.encrypt_with { #[cfg(feature = "aes-crypto")] Some(EncryptWith::Aes { mode, password }) => {