fixed bug #482699
[fw/sdcc] / src / SDCC.lex
index ab68168ece0719e59ea802e323f0fefad70800b8..b67cda3da8f7c1fd7747e2eb381e20574cea6955 100644 (file)
@@ -573,10 +573,13 @@ int yyerror(char *s)
 {
    fflush(stdout);
 
-   if (yylineno && filename)
-       fprintf(stdout,"\n%s:%d: %s: token -> '%s' ; column %d\n",
-               filename,yylineno,
-               s,yytext,column);
-   fatalError++;
+   if (yylineno && filename) {
+     fprintf(stdout,"\n%s:%d: %s: token -> '%s' ; column %d\n",
+            filename,yylineno,
+            s,yytext,column);
+     fatalError++;
+   } else {
+     // this comes from an empy file, no problem
+   }
    return 0;
 }