Skip to content

Commit 7549238

Browse files
authored
Fix FormatExceptions due to Enum.ToString not supporting precision (#15)
1 parent 0e09ebc commit 7549238

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/LibObjectFile/Elf/ElfPrinter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ private static string GetElfNoteDescription(ElfNote note)
365365

366366
if (builder.Length == 0)
367367
{
368-
builder.Append($"Unknown note type: (0x{note.GetNoteType().Value:x8})");
368+
builder.Append($"Unknown note type: (0x{(uint)note.GetNoteType().Value:x8})");
369369
}
370370

371371
builder.Append("\t\t");

src/LibObjectFile/Elf/Sections/ElfNoteType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public ElfNoteTypeEx(ElfNoteType value)
2828

2929
public override string ToString()
3030
{
31-
return ToStringInternal() ?? $"Unknown {nameof(ElfNoteTypeEx)} (0x{Value:X4})";
31+
return ToStringInternal() ?? $"Unknown {nameof(ElfNoteTypeEx)} (0x{(uint)Value:X4})";
3232
}
3333

3434
public bool Equals(ElfNoteTypeEx other)

0 commit comments

Comments
 (0)