diff options
| author | Ada Christine <adachristine18@gmail.com> | 2022-02-13 13:10:49 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2022-02-13 13:10:49 +0000 |
| commit | 43c10da9cf77bb7676db3733499c1b578826dca9 (patch) | |
| tree | 5bee04f8dcc5c9feaf2b85b6cac382075268e14f /kc/core/panic.c | |
| parent | c1d179d50751d0ce08dc2b009fc5e334d20db11a (diff) | |
splitting out descriptor declarations
Diffstat (limited to 'kc/core/panic.c')
| -rw-r--r-- | kc/core/panic.c | 8 |
1 files changed, 5 insertions, 3 deletions
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(); } |
