diff options
author | Freya Murphy <freya@freyacat.org> | 2024-09-20 20:46:37 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-09-20 21:02:38 -0400 |
commit | 3b0a87254f8a1e48a155f5571c274297353a0106 (patch) | |
tree | 8aab94632c01c50e4adafc8a4d062902d5cdfe4e /lib/error.c | |
parent | remove test file (diff) | |
download | mips-3b0a87254f8a1e48a155f5571c274297353a0106.tar.gz mips-3b0a87254f8a1e48a155f5571c274297353a0106.tar.bz2 mips-3b0a87254f8a1e48a155f5571c274297353a0106.zip |
start mld, add loading of object files, add fuzzing support
Diffstat (limited to 'lib/error.c')
-rw-r--r-- | lib/error.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/error.c b/lib/error.c index 352a60d..3d88234 100644 --- a/lib/error.c +++ b/lib/error.c @@ -2,8 +2,8 @@ #include <stdarg.h> #include <stdio.h> -char *current_file = "file.asm"; -int log_disabled = 1; +char *current_file = NULL; +int log_disabled = 0; __attribute__((format(printf, 4, 5))) void __log_impl_pos(int line, int column, int type, const char *format, ...) @@ -27,7 +27,10 @@ void __log_impl_pos(int line, int column, int type, const char *format, ...) break; } - printf("%s:%d:%d: %s ", current_file, line, column, t); + if (current_file != NULL) + printf("%s:%d:%d: %s ", current_file, line, column, t); + else + printf("%s ", t); vprintf(format, list); putchar('\n'); } @@ -54,7 +57,10 @@ void __log_impl(int type, const char *format, ...) break; } - printf("%s ", t); + if (current_file != NULL) + printf("%s: %s ", current_file, t); + else + printf("%s ", t); vprintf(format, list); putchar('\n'); } |