From 43c10da9cf77bb7676db3733499c1b578826dca9 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Sun, 13 Feb 2022 13:10:49 +0000 Subject: splitting out descriptor declarations --- kc/core/panic.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'kc/core/panic.c') diff --git a/kc/core/panic.c b/kc/core/panic.c index b0d9daf..6fd5581 100644 --- a/kc/core/panic.c +++ b/kc/core/panic.c @@ -12,9 +12,11 @@ static char const *reason_strings[] = { noreturn void panic(enum panic_reason reason) { // TODO: kprintf() and friends - kputs("kernel panic: "); - kputs(reason_strings[reason]); - kputs("\n"); + if (reason > sizeof(reason_strings) / sizeof(*reason_strings)) + { + reason = 0; + } + kprintf("kernel panic: %s\n", reason_strings[reason]); halt(); } -- cgit v1.3.1-1-g115d