diff --git a/src/common/bar.c b/src/common/bar.c index 4bd6e76ba..558f5d542 100644 --- a/src/common/bar.c +++ b/src/common/bar.c @@ -78,7 +78,9 @@ void ffAppendPercentNum(FFstrbuf* buffer, double percent, uint8_t green, uint8_t if (colored && !options->pipe) { - if(green < yellow) + if(percent != percent) + ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_LIGHT_BLACK "m"); + else if(green < yellow) { if (percent <= green) ffStrbufAppendS(buffer, "\e[" FF_COLOR_FG_GREEN "m"); diff --git a/src/detection/cpuusage/cpuusage.c b/src/detection/cpuusage/cpuusage.c index 255ee0fed..292a91a28 100644 --- a/src/detection/cpuusage/cpuusage.c +++ b/src/detection/cpuusage/cpuusage.c @@ -40,11 +40,12 @@ retry: FFCpuUsageInfo* cpuTime2 = ffListGet(&cpuTimes2, i); if (cpuTime2->totalAll <= cpuTime1->totalAll) { - ffListClear(&cpuTimes2); - ffTimeSleep(200); - if (++retryCount >= 10) - return "Retry count exceeded"; - goto retry; + if (++retryCount <= 3) + { + ffListClear(&cpuTimes2); + ffTimeSleep(200); + goto retry; + } } }