from Folkert van Heusden's code review

This commit is contained in:
albert
2002-12-28 23:57:10 +00:00
parent 33a8de391e
commit 6b4f2559c6
2 changed files with 6 additions and 6 deletions

View File

@ -313,9 +313,9 @@ static int WriteSetting(const char *setting) {
*
*/
static int Preload(const char *restrict const filename) {
char oneline[256];
char buffer[256];
FILE *fp;
char oneline[257];
char buffer[257];
char *t;
int n = 0;
int rc = 0;
@ -326,8 +326,7 @@ static int Preload(const char *restrict const filename) {
return -1;
}
while (fgets(oneline, 256, fp)) {
oneline[256] = 0;
while (fgets(oneline, sizeof oneline, fp)) {
n++;
t = StripLeadingAndTrailingSpaces(oneline);