don't attempt to parse lines that failed to fetch

This commit is contained in:
Arisotura
2021-05-03 17:02:38 +02:00
parent 41cd092a15
commit b7d5a7db75
2 changed files with 4 additions and 4 deletions

View File

@ -60,8 +60,8 @@ bool ARCodeFile::Load()
char linebuf[1024];
while (!feof(f))
{
if (fgets(linebuf, 1024, f) == NULL)
printf("Error reading string from file!");
if (fgets(linebuf, 1024, f) == nullptr)
break;
linebuf[1023] = '\0';