From 14e15b08a1b9d8ce17516c551e021994094b7ce8 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Sun, 26 Feb 2023 16:04:54 -0800 Subject: [PATCH] minor edits I don't think this is any better? --- implementations/uvm-ncc/xerblin.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/implementations/uvm-ncc/xerblin.c b/implementations/uvm-ncc/xerblin.c index db95a61..f953802 100644 --- a/implementations/uvm-ncc/xerblin.c +++ b/implementations/uvm-ncc/xerblin.c @@ -22,16 +22,11 @@ void draw_char(u8 ch, u64 dest_x, u64 dest_y) { // Check the inputs. - if (ch < 0 || ch > font_Inconsolata_22_number_of_characters) { + if (ch < 0 || ch > font_Inconsolata_22_number_of_characters + || dest_x < 0 || dest_x >= (FRAME_WIDTH - font_Inconsolata_22_width ) + || dest_y < 0 || dest_y >= (FRAME_HEIGHT - font_Inconsolata_22_height)) // No error message or anything, just decline to draw. return; - } - if (dest_x < 0 || dest_x >= (FRAME_WIDTH - font_Inconsolata_22_width)) { - return; - } - if (dest_y < 0 || dest_y >= (FRAME_HEIGHT - font_Inconsolata_22_height)) { - return; - } carefree_alpha_blend_blit( frame_buffer, font_Inconsolata_22_data[ch],