From aeaba3262fc40e66c67c001b46b7458762b1d494 Mon Sep 17 00:00:00 2001 From: Quinn Date: Sat, 22 Mar 2025 12:15:53 +0100 Subject: [PATCH] fix: errors aren't printed correctly, fatals are also not visually distinct --- src/error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.c b/src/error.c index adc2c00..1939e29 100644 --- a/src/error.c +++ b/src/error.c @@ -52,7 +52,7 @@ void warn(char const* fmt, ...) { void error(char const* fmt, ...) { char buf[PRINT_BUFFER_SIZE] = {0}; write_args(buf, fmt); - (void)fprintf(stderr, "\033[mW: %s\033[0m", buf); + (void)fprintf(stderr, "\033[91mE: %s\033[0m", buf); } noreturn void fatal(gamestatus error_code, char const* fname, uint32_t ln, char const* fmt, ...) { @@ -62,7 +62,7 @@ noreturn void fatal(gamestatus error_code, char const* fname, uint32_t ln, char char buf2[PRINT_BUFFER_SIZE * 2] = {0}; sprintf(buf2, "%s\n at %s:%u (exitcode: %u)", buf1, fname, ln, error_code); - (void)fprintf(stderr, "\033[91mE: %s\033[0m\n", buf2); + (void)fprintf(stderr, "\033[101mF: %s\033[0m\n", buf2); SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "something went wrong! :O", buf2, NULL); // set status, but exit immediately, as code is not allowed to execute beyond this point