Bug fix: replace max with min
This commit is contained in:
parent
ee1ef05fe6
commit
806c5d9fd8
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ fn decompress_all(data: &[u8]) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
||||||
for i in 0..zip.len() {
|
for i in 0..zip.len() {
|
||||||
let file = zip.by_index(i)?;
|
let file = zip.by_index(i)?;
|
||||||
let expected_bytes = file.size().max(MAX_BYTES_TO_READ);
|
let expected_bytes = file.size().min(MAX_BYTES_TO_READ);
|
||||||
let result = std::io::copy(&mut file.take(MAX_BYTES_TO_READ), &mut std::io::sink());
|
let result = std::io::copy(&mut file.take(MAX_BYTES_TO_READ), &mut std::io::sink());
|
||||||
if let Ok(bytes) = result {
|
if let Ok(bytes) = result {
|
||||||
assert!(bytes <= expected_bytes)
|
assert!(bytes <= expected_bytes)
|
||||||
|
|
Loading…
Add table
Reference in a new issue