From dcb1789fcacf006b0580ef2aed1d47fa6097b68a Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Thu, 9 Mar 2023 00:30:48 -0500 Subject: [PATCH] [F] Fix bound checking --- tngame-rs/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tngame-rs/src/main.rs b/tngame-rs/src/main.rs index da97e93..35f9c4c 100644 --- a/tngame-rs/src/main.rs +++ b/tngame-rs/src/main.rs @@ -262,7 +262,7 @@ impl Mutes { // Draw the character in the buffer let x = x + j as i32; let y = y + i as i32; - if 0 < x && x < self.w as i32 && 0 < y && y < self.h as i32 { + if 0 <= x && x < self.w as i32 && 0 <= y && y < self.h as i32 { self.buf[y as usize][x as usize] = Some(Pixel { color, char: c }); } }