clean: simplify code && maybe fix

This commit is contained in:
Starnakin 2024-12-19 00:22:02 +01:00
parent 4a99b82e15
commit 6bdba0cb4f
2 changed files with 3 additions and 4 deletions

View File

@ -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;

View File

@ -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);
}