Commit b7d5a7db authored by Arisotura's avatar Arisotura
Browse files

don't attempt to parse lines that failed to fetch

parent 41cd092a
......@@ -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';
......
......@@ -119,8 +119,8 @@ void Load()
char entryval[1024];
while (!feof(f))
{
if (fgets(linebuf, 1024, f) == NULL)
printf("Error reading string from file!");
if (fgets(linebuf, 1024, f) == nullptr)
break;
int ret = sscanf(linebuf, "%31[A-Za-z_0-9]=%[^\t\r\n]", entryname, entryval);
entryname[31] = '\0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment