mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-28 01:28:30 +00:00
Fix more sonar issues.
This commit is contained in:
parent
3df87776d5
commit
d422aa47d2
@ -1014,7 +1014,7 @@ int update_stat(void) {
|
||||
|
||||
cpu[idx].cpu_last_total = cpu[idx].cpu_total;
|
||||
cpu[idx].cpu_last_active_total = cpu[idx].cpu_active_total;
|
||||
for (i = samples - 1; i > 0; i--) {
|
||||
for (i = samples - 1; i > 0 && i < CPU_SAMPLE_COUNT; i--) {
|
||||
cpu[idx].cpu_val[i] = cpu[idx].cpu_val[i - 1];
|
||||
}
|
||||
}
|
||||
|
10
src/mail.cc
10
src/mail.cc
@ -814,7 +814,10 @@ void imap_cb::work() {
|
||||
}
|
||||
if (buf != nullptr) {
|
||||
// back up until we reach '*'
|
||||
while (buf >= recvbuf && buf[0] != '*') { buf--; }
|
||||
while (buf >= recvbuf && buf < (recvbuf + MAXDATASIZE) - 1 &&
|
||||
buf[0] != '*') {
|
||||
buf--;
|
||||
}
|
||||
if (sscanf(buf, "* %lu EXISTS\r\n", &messages) == 1) {
|
||||
std::lock_guard<std::mutex> lock(result_mutex);
|
||||
if (result.messages != messages) {
|
||||
@ -831,7 +834,10 @@ void imap_cb::work() {
|
||||
}
|
||||
if (buf != nullptr) {
|
||||
// back up until we reach '*'
|
||||
while (buf >= recvbuf && buf[0] != '*') { buf--; }
|
||||
while (buf >= recvbuf && buf < (recvbuf + MAXDATASIZE) - 1 &&
|
||||
buf[0] != '*') {
|
||||
buf--;
|
||||
}
|
||||
if (sscanf(buf, "* %lu RECENT\r\n", &recent) != 1) { recent = 0; }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user