Skip to content

Commit

Permalink
chore: Fix a failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean committed Jun 20, 2024
1 parent 9a27fb8 commit 27c7fa4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::crc32::Crc32Reader;
use crate::extra_fields::{ExtendedTimestamp, ExtraField};
use crate::read::zip_archive::{Shared, SharedBuilder};
use crate::result::{ZipError, ZipResult};
use crate::spec::{self, FixedSizeBlock, Zip32CentralDirectoryEnd};
use crate::spec::{self, FixedSizeBlock, Zip32CentralDirectoryEnd, ZIP64_ENTRY_THR};
use crate::types::{
AesMode, AesVendorVersion, DateTime, System, ZipCentralEntryBlock, ZipFileData,
ZipLocalEntryBlock,
Expand Down Expand Up @@ -772,7 +772,8 @@ impl<R: Read + Seek> ZipArchive<R> {
}
Err(e) => invalid_errors.push(e),
Ok(o) => {
if o.files.len() >= footer.number_of_files as usize {
if o.files.len() == footer.number_of_files as usize
|| footer.number_of_files == ZIP64_ENTRY_THR as u16 {
ok_results.push((footer.clone(), o))
} else {
invalid_errors.push(InvalidArchive("wrong number of files"))
Expand Down

0 comments on commit 27c7fa4

Please sign in to comment.