Commit b0588d90 authored by Jan Chren (rindeal)'s avatar Jan Chren (rindeal) Committed by Hisham Muhammad
Browse files

parseBatInfo: check `line` for NULL before passing it to String_getToken()

parent b84ebfd4
...@@ -72,6 +72,8 @@ static unsigned long int parseBatInfo(const char *fileName, const unsigned short ...@@ -72,6 +72,8 @@ static unsigned long int parseBatInfo(const char *fileName, const unsigned short
fclose(file); fclose(file);
if (!line) break;
char *foundNumStr = String_getToken(line, wordNum); char *foundNumStr = String_getToken(line, wordNum);
const unsigned long int foundNum = atoi(foundNumStr); const unsigned long int foundNum = atoi(foundNumStr);
free(foundNumStr); free(foundNumStr);
......
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