Skip to content

Commit

Permalink
render: check bounds when setting skipped
Browse files Browse the repository at this point in the history
A double-wide character in the last cell can force this to go OOB.

Signed-off-by: Tim Culverhouse <[email protected]>
  • Loading branch information
rockorager committed Mar 7, 2024
1 parent 378984b commit 6dafeb7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/vaxis.zig
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ pub fn Vaxis(comptime T: type) type {
std.debug.assert(w > 0);
var j = i + 1;
while (j < i + w) : (j += 1) {
if (j >= self.screen_last.buf.len) break;
self.screen_last.buf[j].skipped = true;
}
col += w;
Expand Down

0 comments on commit 6dafeb7

Please sign in to comment.