lex/parser.y fix Segmentation fault

Check the EOF first.
This commit is contained in:
Hojun-Cho 2024-12-27 22:35:10 +09:00
parent 61e362add9
commit 503a62a822

View file

@ -620,7 +620,7 @@ yylex(void)
if(debug)
Bprint(&fout,"\n/*this comes from section three - debug */\n");
# endif
while(getl(buf) && !eof)
while(!eof && getl(buf))
Bprint(&fout,"%s\n",(char*)buf);
return(freturn(0));
}