screen: fix off by one error in writeCell bounds checks
This commit is contained in:
parent
329ba0e43b
commit
0333e178bd
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue