diff --git a/src/shell/exec.c b/src/shell/exec.c index 2d973d9..ce7459f 100644 --- a/src/shell/exec.c +++ b/src/shell/exec.c @@ -86,7 +86,7 @@ static char *get_line(void) struct key_event ev; const size_t size = sizeof(screen->line); - while (1) { + do { ev = get_key(); if (!ev.scan_code) continue; @@ -105,9 +105,7 @@ static char *get_line(void) kprintf("%c", ev.c); buf[i++] = ev.c; } - if (i >= size) - break; - } + } while (i < size); kprintf("\n"); screen->line[i] = '\0'; return screen->line; diff --git a/src/terminal/put.c b/src/terminal/put.c index ed268ed..39d6c61 100644 --- a/src/terminal/put.c +++ b/src/terminal/put.c @@ -30,6 +30,7 @@ void terminal_initialize(void) screens[i].fg_color = screens[i].default_color; screens[i].backgound = &image_icon; screens[i].font = eating_pasta_regular_13_font; + memset(screens[i].line, 0, sizeof(screen->line)); } // draw_icon(0, 0, screen->backgound); }