diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-03 23:57:33 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-03 23:57:33 -0500 |
commit | 50c892e0a68c7e6d17ce49edf0c13ada7e1cdbfc (patch) | |
tree | 024761d74f69ebd869ece7475c935b0157b42ff3 /err.c | |
parent | 5665bde91427725cf0231cab7e54a6b37b6fba7f (diff) |
fixed a bug with returning
Diffstat (limited to 'err.c')
-rw-r--r-- | err.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -55,6 +55,8 @@ static void err_vfprint(const char *fmt, va_list args) { } static void err_print_header_(Location where) { + if (!where.ctx) + err_fprint("Error (no location available):\n"); #if ERR_EMACS err_fprint("%s:%lu: " TEXT_ERROR("error") ":\n", where.ctx->filename, (unsigned long)where.line); #else @@ -63,6 +65,8 @@ static void err_print_header_(Location where) { } static void info_print_header_(Location where) { + if (!where.ctx) + err_fprint("Info (no location available):\n"); #if ERR_EMACS err_fprint("%s:%lu: " TEXT_INFO("info") ":\n", where.ctx->filename, (unsigned long)where.line); #else @@ -71,6 +75,8 @@ static void info_print_header_(Location where) { } static void warn_print_header_(Location where) { + if (!where.ctx) + err_fprint("Warning (no location available):\n"); #if ERR_EMACS err_fprint("%s:%lu: " TEXT_WARN("warning") ":\n", where.ctx->filename, (unsigned long)where.line); #else |