chore: Fix a bug where a modulo of 0 was used

This commit is contained in:
Chris Hennick 2024-06-13 22:22:56 -07:00
parent 3436a569ab
commit bf3e7510a6
No known key found for this signature in database
GPG key ID: DA47AABA4961C509

View file

@ -966,7 +966,7 @@ impl<W: Write + Seek> ZipWriter<W> {
file.extra_data_start = Some(writer.stream_position()?);
writer.write_all(&extensions.extra_data)?;
extra_data_end = writer.stream_position()?;
debug_assert_eq!(extra_data_end % (options.alignment as u64), 0);
debug_assert_eq!(extra_data_end % (options.alignment.max(1) as u64), 0);
self.stats.start = extra_data_end;
debug_assert!(file.data_start.get().is_none());
file.data_start.get_or_init(|| extra_data_end);