Replace u32_len with constant

This commit is contained in:
Rune Tynan 2023-02-13 13:45:15 -05:00
parent a9c3eb91e9
commit c14edf90db
No known key found for this signature in database
GPG Key ID: 7ECC932F8B2C731E

View File

@ -789,8 +789,8 @@ fn get_metadata_section<'p>(
loader.get_dylib_metadata(target, filename).map_err(MetadataError::LoadFailure)?;
// The header is uncompressed
let header_len = METADATA_HEADER.len();
let u32_len = core::mem::size_of::<u32>();
let data_start = header_len + u32_len;
// header + u32 length of data
let data_start = header_len + 4;
debug!("checking {} bytes of metadata-version stamp", header_len);
let header = &buf[..cmp::min(header_len, buf.len())];