]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
quick and dirty fix to lexerror for when fopen fails
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 17 Nov 2012 09:36:35 +0000 (10:36 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 17 Nov 2012 09:36:35 +0000 (10:36 +0100)
lexer.c

diff --git a/lexer.c b/lexer.c
index 96644c2623094d61ff54441bcebbbe66303dd1b8..513499a708bbe35a23c4e68f20cc8f09952b022c 100644 (file)
--- 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);
 }