screen: fix off by one error in readCell bounds checks
This commit is contained in:
parent
0333e178bd
commit
9906a67ef6
1 changed files with 2 additions and 2 deletions
|
@ -66,11 +66,11 @@ pub fn writeCell(self: *Screen, col: usize, row: usize, cell: Cell) void {
|
|||
}
|
||||
|
||||
pub fn readCell(self: *Screen, col: usize, row: usize) ?Cell {
|
||||
if (self.width < col) {
|
||||
if (self.width <= col) {
|
||||
// column out of bounds
|
||||
return null;
|
||||
}
|
||||
if (self.height < row) {
|
||||
if (self.height <= row) {
|
||||
// height out of bounds
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue