Skip to content

Commit

Permalink
Escape < and > in error messages (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnau478 authored Aug 13, 2024
1 parent 3ab363f commit be6b711
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/exes/server/AnsiRenderer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ fn render(renderer: *AnsiRenderer, reader: anytype, writer: anytype) !void {
.normal => switch (char) {
'\x1b' => renderer.state = .escape,
else => switch (renderer.g0_charset) {
.ascii => try writer.writeByte(char),
.ascii => {
_ = try writer.write(switch (char) {
'<' => "&lt;",
'>' => "&gt;",
else => &.{char},
});
},
.vt100_line_drawing => {
_ = try writer.write(switch (char) {
'j' => "┘",
Expand Down

0 comments on commit be6b711

Please sign in to comment.