diff options
author | Jan Chren (rindeal) <dev.rindeal@gmail.com> | 2017-05-06 01:25:20 +0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-04 17:04:47 +0100 |
commit | b0588d90ff6df729adfa44e4a5134ecb66705f5e (patch) | |
tree | 8c1126c303e58577fca8b80b5ebd813a530225e0 /linux | |
parent | b84ebfd4e83668ae617c9205b79c98e51574c7b9 (diff) |
parseBatInfo: check `line` for NULL before passing it to String_getToken()
Diffstat (limited to 'linux')
-rw-r--r-- | linux/Battery.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/linux/Battery.c b/linux/Battery.c index 761b8ad7..34a24011 100644 --- a/linux/Battery.c +++ b/linux/Battery.c @@ -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); |