Skip to content

Commit a42434e

Browse files
committed
Fix magic number printing
1 parent 427b624 commit a42434e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/COFF/COFFHandle.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ function readmeta(io::IO, ::Type{H}) where {H <: COFFHandle}
4949
magic = [read(io, UInt8) for idx in 1:4]
5050
if any(magic .!= PE_magic)
5151
msg = """
52-
Magic Number 0x$(join(string.(magic, base=16),"")) does not match expected PE
53-
magic number 0x$(join("", string.(PE_magic, base=16)))
52+
Magic Number 0x$(join(string.(magic, base=16, pad=2),"")) does not match expected PE
53+
magic number 0x$(join(string.(PE_magic, base=16, pad=2),""))
5454
"""
5555
throw(MagicMismatch(replace(strip(msg), "\n" => " ")))
5656
end

src/ELF/ELFHandle.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ function readmeta(io::IO, ::Type{H}) where {H <: ELFHandle}
3838
magic = [read(io, UInt8) for idx in 1:4]
3939
if any(magic .!= elven_magic)
4040
msg = """
41-
Magic Number 0x$(join(string.(magic, base=16),"")) does not match expected ELF
42-
magic number 0x$(join("", string.(elven_magic, base=16)))
41+
Magic Number 0x$(join(string.(magic, base=16, pad=2),"")) does not match expected ELF
42+
magic number 0x$(join(string.(elven_magic, base=16, pad=2),""))
4343
"""
4444
throw(MagicMismatch(replace(strip(msg), "\n" => " ")))
4545
end

0 commit comments

Comments
 (0)