Add EOF checking in string reading

Fixes rednex/#422
This commit is contained in:
ISSOtm
2019-10-09 15:05:54 +02:00
parent 8c91b31ae6
commit f2e1b7d868

View File

@@ -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;
} }