From d2493caa9018dd44cc0557ea1cc1c0af363bb61a Mon Sep 17 00:00:00 2001 From: MainSilent <70273681+MainSilent@users.noreply.github.com> Date: Wed, 11 Nov 2020 22:05:51 +0330 Subject: [PATCH] Update screen.c --- 23-fixes/drivers/screen.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/23-fixes/drivers/screen.c b/23-fixes/drivers/screen.c index 1aed626..428d83d 100644 --- a/23-fixes/drivers/screen.c +++ b/23-fixes/drivers/screen.c @@ -44,11 +44,13 @@ void kprint(char *message) { kprint_at(message, -1, -1); } -void kprint_backspace() { - int offset = get_cursor_offset()-2; - int row = get_offset_row(offset); - int col = get_offset_col(offset); - print_char(0x08, col, row, WHITE_ON_BLACK); +void kprint_backspace(char key_buffer[256]) { + if (strlen(key_buffer) != 0) { + int offset = get_cursor_offset()-2; + int row = get_offset_row(offset); + int col = get_offset_col(offset); + print_char(0x08, col, row, WHITE_ON_BLACK); + } }