render: check bounds when setting skipped

A double-wide character in the last cell can force this to go OOB.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tim Culverhouse 2024-03-06 19:23:47 -06:00
parent 378984bd87
commit 6dafeb7820

View file

@ -300,6 +300,7 @@ pub fn Vaxis(comptime T: type) type {
std.debug.assert(w > 0); std.debug.assert(w > 0);
var j = i + 1; var j = i + 1;
while (j < i + w) : (j += 1) { while (j < i + w) : (j += 1) {
if (j >= self.screen_last.buf.len) break;
self.screen_last.buf[j].skipped = true; self.screen_last.buf[j].skipped = true;
} }
col += w; col += w;