elf.rs: do not inline constant from goblin library

SELFMAG is declared [here](de8aecc8f1/src/elf/header.rs (L91)).
This commit is contained in:
Paweł Zmarzły
2017-11-13 20:24:50 +01:00
committed by GitHub
parent 9e9f80ef13
commit 20f262c4ed

View File

@@ -22,7 +22,7 @@ impl<'a> Elf<'a> {
if data.len() < header::SIZEOF_EHDR {
Err(format!("Elf: Not enough data: {} < {}", data.len(), header::SIZEOF_EHDR))
} else if &data[..header::SELFMAG] != header::ELFMAG {
Err(format!("Elf: Invalid magic: {:?} != {:?}", &data[..4], header::ELFMAG))
Err(format!("Elf: Invalid magic: {:?} != {:?}", &data[..header::SELFMAG], header::ELFMAG))
} else if data.get(header::EI_CLASS) != Some(&header::ELFCLASS) {
Err(format!("Elf: Invalid architecture: {:?} != {:?}", data.get(header::EI_CLASS), header::ELFCLASS))
} else {