mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 18:52:07 +00:00
Add EOF checking in string reading
Fixes rednex/#422
This commit is contained in:
@@ -127,6 +127,8 @@ static char *readstr(FILE *file)
|
||||
}
|
||||
/* Read char */
|
||||
str[index] = getc(file);
|
||||
if (str[index] == EOF)
|
||||
return NULL;
|
||||
} while (str[index]);
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user