Commit 9eec37c4 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

More sanity checks.

parent 27da00f3
...@@ -85,9 +85,10 @@ static unsigned long int parseBatInfo(const char *fileName, const unsigned short ...@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment