mirror of https://github.com/xzeldon/htop.git
parseBatInfo: check `line` for NULL before passing it to String_getToken()
This commit is contained in:
parent
b84ebfd4e8
commit
b0588d90ff
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue