More sanity checks.

This commit is contained in:
Hisham Muhammad 2014-04-24 19:54:06 -03:00
parent 27da00f339
commit 9eec37c432
1 changed files with 3 additions and 2 deletions

View File

@ -85,9 +85,10 @@ static unsigned long int parseBatInfo(const char *fileName, const unsigned short
break; break;
} }
char line[50]; char line[50] = "";
for (unsigned short int i = 0; i < lineNum; i++) { for (unsigned short int i = 0; i < lineNum; i++) {
fgets(line, sizeof line, file); char* ok = fgets(line, sizeof line, file);
if (!ok) break;
} }
fclose(file); fclose(file);