summaryrefslogtreecommitdiff
path: root/err.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-01-03 23:57:33 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-01-03 23:57:33 -0500
commit50c892e0a68c7e6d17ce49edf0c13ada7e1cdbfc (patch)
tree024761d74f69ebd869ece7475c935b0157b42ff3 /err.c
parent5665bde91427725cf0231cab7e54a6b37b6fba7f (diff)
fixed a bug with returning
Diffstat (limited to 'err.c')
-rw-r--r--err.c6
1 files changed, 6 insertions, 0 deletions
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