From 50c892e0a68c7e6d17ce49edf0c13ada7e1cdbfc Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Fri, 3 Jan 2020 23:57:33 -0500 Subject: fixed a bug with returning --- err.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'err.c') diff --git a/err.c b/err.c index 6d57cdc..1ca103e 100644 --- a/err.c +++ b/err.c @@ -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 -- cgit v1.2.3