From 02307378b2e301723cb7d5c656c0583b5c8915a0 Mon Sep 17 00:00:00 2001 From: Truman Kilen Date: Fri, 10 Feb 2023 22:29:04 -0600 Subject: [PATCH] Fix writing wrong block size --- repak/src/entry.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repak/src/entry.rs b/repak/src/entry.rs index 80636ce..49f2185 100644 --- a/repak/src/entry.rs +++ b/repak/src/entry.rs @@ -176,10 +176,10 @@ impl Entry { assert!(self.blocks.is_some()); let blocks = self.blocks.as_ref().unwrap(); - if blocks.len() > 1 && !(blocks.len() == 1 && !self.encrypted) { + if !blocks.len() == 1 || self.encrypted { for b in blocks { let block_size = b.end - b.start; - writer.write_u64::(block_size)? + writer.write_u32::(block_size.try_into().unwrap())?; } } }