Commit e3592281da

Jakub Konka <kubkon@jakubkonka.com>
2023-12-05 14:39:56
elf: escape invalid token string when reporting an error
1 parent e349bb2
Changed files (1)
src
link
src/link/Elf/LdScript.zig
@@ -32,7 +32,7 @@ pub fn parse(scr: *LdScript, data: []const u8, elf_file: *Elf) Error!void {
         switch (tok.id) {
             .invalid => {
                 try elf_file.reportParseError(scr.path, "invalid token in LD script: '{s}' ({d}:{d})", .{
-                    tok.get(data),
+                    std.fmt.fmtSliceEscapeLower(tok.get(data)),
                     line,
                     column,
                 });