mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 13:20:57 -06:00
don't attempt to parse lines that failed to fetch
This commit is contained in:
@ -60,8 +60,8 @@ bool ARCodeFile::Load()
|
|||||||
char linebuf[1024];
|
char linebuf[1024];
|
||||||
while (!feof(f))
|
while (!feof(f))
|
||||||
{
|
{
|
||||||
if (fgets(linebuf, 1024, f) == NULL)
|
if (fgets(linebuf, 1024, f) == nullptr)
|
||||||
printf("Error reading string from file!");
|
break;
|
||||||
|
|
||||||
linebuf[1023] = '\0';
|
linebuf[1023] = '\0';
|
||||||
|
|
||||||
|
@ -119,8 +119,8 @@ void Load()
|
|||||||
char entryval[1024];
|
char entryval[1024];
|
||||||
while (!feof(f))
|
while (!feof(f))
|
||||||
{
|
{
|
||||||
if (fgets(linebuf, 1024, f) == NULL)
|
if (fgets(linebuf, 1024, f) == nullptr)
|
||||||
printf("Error reading string from file!");
|
break;
|
||||||
|
|
||||||
int ret = sscanf(linebuf, "%31[A-Za-z_0-9]=%[^\t\r\n]", entryname, entryval);
|
int ret = sscanf(linebuf, "%31[A-Za-z_0-9]=%[^\t\r\n]", entryname, entryval);
|
||||||
entryname[31] = '\0';
|
entryname[31] = '\0';
|
||||||
|
Reference in New Issue
Block a user