mirror of https://github.com/xzeldon/htop.git
Make static analyzers happy.
This commit is contained in:
parent
814ce89b45
commit
50b701258d
|
@ -64,8 +64,8 @@ static unsigned long int parseBatInfo(const char *fileName, const unsigned short
|
||||||
struct dirent result;
|
struct dirent result;
|
||||||
struct dirent* dirEntry;
|
struct dirent* dirEntry;
|
||||||
while (nBatteries < MAX_BATTERIES) {
|
while (nBatteries < MAX_BATTERIES) {
|
||||||
readdir_r(batteryDir, &result, &dirEntry);
|
int err = readdir_r(batteryDir, &result, &dirEntry);
|
||||||
if (!dirEntry)
|
if (err || !dirEntry)
|
||||||
break;
|
break;
|
||||||
char* entryName = dirEntry->d_name;
|
char* entryName = dirEntry->d_name;
|
||||||
if (strncmp(entryName, "BAT", 3))
|
if (strncmp(entryName, "BAT", 3))
|
||||||
|
@ -117,8 +117,8 @@ static ACPresence procAcpiCheck() {
|
||||||
struct dirent result;
|
struct dirent result;
|
||||||
struct dirent* dirEntry;
|
struct dirent* dirEntry;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
readdir_r((DIR *) power_supplyDir, &result, &dirEntry);
|
int err = readdir_r((DIR *) power_supplyDir, &result, &dirEntry);
|
||||||
if (!dirEntry)
|
if (err || !dirEntry)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
char* entryName = (char *) dirEntry->d_name;
|
char* entryName = (char *) dirEntry->d_name;
|
||||||
|
@ -170,8 +170,8 @@ static ACPresence sysCheck() {
|
||||||
struct dirent result;
|
struct dirent result;
|
||||||
struct dirent* dirEntry;
|
struct dirent* dirEntry;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
readdir_r((DIR *) power_supplyDir, &result, &dirEntry);
|
int err = readdir_r((DIR *) power_supplyDir, &result, &dirEntry);
|
||||||
if (!dirEntry)
|
if (err || !dirEntry)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
char* entryName = (char *) dirEntry->d_name;
|
char* entryName = (char *) dirEntry->d_name;
|
||||||
|
@ -233,8 +233,8 @@ static double getSysBatData() {
|
||||||
struct dirent result;
|
struct dirent result;
|
||||||
struct dirent* dirEntry;
|
struct dirent* dirEntry;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
readdir_r((DIR *) power_supplyDir, &result, &dirEntry);
|
int err = readdir_r((DIR *) power_supplyDir, &result, &dirEntry);
|
||||||
if (!dirEntry)
|
if (err || !dirEntry)
|
||||||
break;
|
break;
|
||||||
char* entryName = (char *) dirEntry->d_name;
|
char* entryName = (char *) dirEntry->d_name;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue