From: Wolfgang (Blub) Bumiller Date: Sat, 17 Nov 2012 09:36:35 +0000 (+0100) Subject: quick and dirty fix to lexerror for when fopen fails X-Git-Tag: 0.1~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=33be9edec7bf3923e2497e6077b5c2ebc96d7ca0;p=xonotic%2Fgmqcc.git quick and dirty fix to lexerror for when fopen fails --- 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); }