Fix writing wrong block size

This commit is contained in:
Truman Kilen 2023-02-10 22:29:04 -06:00
parent 0e05acadb0
commit 02307378b2

View file

@ -176,10 +176,10 @@ impl Entry {
assert!(self.blocks.is_some()); assert!(self.blocks.is_some());
let blocks = self.blocks.as_ref().unwrap(); 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 { for b in blocks {
let block_size = b.end - b.start; let block_size = b.end - b.start;
writer.write_u64::<LE>(block_size)? writer.write_u32::<LE>(block_size.try_into().unwrap())?;
} }
} }
} }