rename 'error' to 'fatal', add 'error' which just logs

mainly because we sometimes would like to just write an error without
terminating the program
This commit is contained in:
2025-03-18 14:50:31 +01:00
parent 972aeb61e7
commit 6e6e05c48c
5 changed files with 18 additions and 11 deletions

View File

@@ -49,7 +49,13 @@ void warn(char const* fmt, ...) {
(void)fprintf(stderr, "\033[93mW: %s\033[0m\n", buf);
}
noreturn void error(gamestatus error_code, char const* fname, uint32_t ln, 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);
}
noreturn void fatal(gamestatus error_code, char const* fname, uint32_t ln, char const* fmt, ...) {
char buf1[PRINT_BUFFER_SIZE] = {0};
write_args(buf1, fmt);