turn some comparsions for a better readability

Origin commit data
------------------
Commit: bee4cb4959
Author: vanhofen <vanhofen@gmx.de>
Date: 2024-03-25 (Mon, 25 Mar 2024)

Origin message was:
------------------
- turn some comparsions for a better readability

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2024-03-25 20:29:55 +01:00
committed by Thilo Graf
parent f7f1f4d6e6
commit 14240c3c4a
15 changed files with 89 additions and 98 deletions

View File

@@ -563,7 +563,7 @@ std::string CNetAdapter::getMacAddr(void)
long stat;
u_char addr[6];
stat = mac_addr_sys(addr);
if (0 == stat)
if (stat == 0)
{
std::stringstream mac_tmp;
for (int i = 0; i < 6; ++i)

View File

@@ -61,7 +61,7 @@ void *cSysLoad::Run(void *arg)
std::string line;
while (getline(in, line)) {
unsigned long _stat_user, _stat_nice, _stat_system, _stat_idle;
if (4 == sscanf(line.c_str(), "cpu %lu %lu %lu %lu", &_stat_user, &_stat_nice, &_stat_system, &_stat_idle)) {
if (sscanf(line.c_str(), "cpu %lu %lu %lu %lu", &_stat_user, &_stat_nice, &_stat_system, &_stat_idle) == 4) {
unsigned long _stat_total = _stat_user + _stat_nice + _stat_system + _stat_idle;
if (stat_total) {
unsigned long div = _stat_total - stat_total;