From 0333e178bdccb786bf8ceedb7203068b8177716d Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Fri, 17 May 2024 21:55:44 +0200 Subject: [PATCH] screen: fix off by one error in writeCell bounds checks --- src/Screen.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Screen.zig b/src/Screen.zig index 8748e3e..6d464bf 100644 --- a/src/Screen.zig +++ b/src/Screen.zig @@ -52,11 +52,11 @@ pub fn deinit(self: *Screen, alloc: std.mem.Allocator) void { /// writes a cell to a location. 0 indexed pub fn writeCell(self: *Screen, col: usize, row: usize, cell: Cell) void { - if (self.width < col) { + if (self.width <= col) { // column out of bounds return; } - if (self.height < row) { + if (self.height <= row) { // height out of bounds return; }