mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +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 */
|
/* Read char */
|
||||||
str[index] = getc(file);
|
str[index] = getc(file);
|
||||||
|
if (str[index] == EOF)
|
||||||
|
return NULL;
|
||||||
} while (str[index]);
|
} while (str[index]);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user