summaryrefslogtreecommitdiff
path: root/err.c
diff options
context:
space:
mode:
Diffstat (limited to 'err.c')
-rw-r--r--err.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/err.c b/err.c
index 0a519c1..a98a822 100644
--- a/err.c
+++ b/err.c
@@ -126,7 +126,7 @@ static void err_print_footer_(Location where) {
static void err_vprint(Location where, const char *fmt, va_list args) {
- if (!where.ctx->enabled) return;
+ if (where.ctx && !where.ctx->enabled) return;
err_print_header_(where);
err_vfprint(fmt, args);
err_print_footer_(where);
@@ -139,8 +139,8 @@ static void err_print_(
#endif
Location where, const char *fmt, ...) {
va_list args;
- if (where.ctx && !where.ctx->enabled) return;
#if ERR_SHOW_SOURCE_LOCATION
+ if (where.ctx && !where.ctx->enabled) return;
if (file)
err_fprint("Generated by line %d of %s:\n", line, file);
#endif