From 5410ebd1f6a44c60220ca630ff34520252930f93 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 21 Jun 2010 02:08:48 +0200 Subject: [PATCH] Don't read outside of VGA screen --- term/i386/pc/vga_text.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/term/i386/pc/vga_text.c b/term/i386/pc/vga_text.c index bfa934a40..717a7576e 100644 --- a/term/i386/pc/vga_text.c +++ b/term/i386/pc/vga_text.c @@ -58,9 +58,11 @@ inc_y (void) else { int x, y; - for (y = 0; y < ROWS; y++) + for (y = 0; y < ROWS - 1; y++) for (x = 0; x < COLS; x++) screen_write_char (x, y, screen_read_char (x, y + 1)); + for (x = 0; x < COLS; x++) + screen_write_char (x, ROWS - 1, ' ' | (grub_console_cur_color << 8)); } }