mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
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);
|
||||
|
||||
if (!line) break;
|
||||
|
||||
char *foundNumStr = String_getToken(line, wordNum);
|
||||
const unsigned long int foundNum = atoi(foundNumStr);
|
||||
free(foundNumStr);
|
||||
|
Loading…
Reference in New Issue
Block a user