From 33be9edec7bf3923e2497e6077b5c2ebc96d7ca0 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sat, 17 Nov 2012 10:36:35 +0100 Subject: [PATCH] quick and dirty fix to lexerror for when fopen fails --- lexer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lexer.c b/lexer.c index 96644c2..513499a 100644 --- a/lexer.c +++ b/lexer.c @@ -13,7 +13,10 @@ void lexerror(lex_file *lex, const char *fmt, ...) va_list ap; va_start(ap, fmt); - con_vprintmsg(LVL_ERROR, lex->name, lex->sline, "parse error", fmt, ap); + if (lex) + con_vprintmsg(LVL_ERROR, lex->name, lex->sline, "parse error", fmt, ap); + else + con_vprintmsg(LVL_ERROR, "", 0, "parse error", fmt, ap); va_end(ap); } -- 2.39.2