X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=lexer.c;h=34da7d8a97fa1cf107ceef47cb9be2a3518dc9b7;hp=de09bfa2f4b85848dfba2bb0b28b444b809fe8c9;hb=79abe3fb6d9cf6c0d5f234d64fd77181b2c2317d;hpb=515cafe8bd17a64f38c6bba73d234e79a215b775 diff --git a/lexer.c b/lexer.c index de09bfa..34da7d8 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); }