Bug fixes

This commit is contained in:
Chris Hennick 2023-05-13 14:44:46 -07:00
parent ba4d6548ed
commit 0ae9dab6ab
No known key found for this signature in database
GPG key ID: 25653935CC8B6C74

View file

@ -152,16 +152,16 @@ impl arbitrary::Arbitrary<'_> for FileOptions {
central_extra_data: Vec::with_capacity(u16::MAX as usize), central_extra_data: Vec::with_capacity(u16::MAX as usize),
alignment: u8::arbitrary(u)? as u16 + 1, alignment: u8::arbitrary(u)? as u16 + 1,
}; };
u.arbitrary_loop(None, Some(16383), || { u.arbitrary_loop(None, Some(16383), |u| {
options options
.add_extra_data( .add_extra_data(
u16::arbitrary(u)?, u16::arbitrary(u)?,
Vec::<u8>::arbitrary(u)?, &Vec::<u8>::arbitrary(u)?,
bool::arbitrary(u)?, bool::arbitrary(u)?,
) )
.map_err(|_| arbitrary::Error::IncorrectFormat)?; .map_err(|_| arbitrary::Error::IncorrectFormat)?;
Ok(core::ops::ControlFlow::Continue(())) Ok(core::ops::ControlFlow::Continue(()))
}); })?;
Ok(options) Ok(options)
} }
} }