mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
Fix last 'fix'
This commit is contained in:
parent
9345e2bb8f
commit
5626eade7f
@ -2840,11 +2840,7 @@ static struct text_object *construct_text_object(const char *s,
|
||||
END OBJ(cached, INFO_BUFFERS)
|
||||
END OBJ(cpu, INFO_CPU)
|
||||
if (arg) {
|
||||
if (strncmp(arg, "cpu", 4) == EQUAL && isdigit(arg[3]) && isdigit(arg[4])) {
|
||||
obj->data.cpu_index = atoi(&arg[3]) * 10;
|
||||
obj->data.cpu_index += atoi(&arg[4]);
|
||||
arg += 5;
|
||||
} else if (strncmp(arg, "cpu", 3) == EQUAL && isdigit(arg[3])) {
|
||||
if (strncmp(arg, "cpu", 3) == EQUAL && isdigit(arg[3])) {
|
||||
obj->data.cpu_index = atoi(&arg[3]);
|
||||
arg += 4;
|
||||
} else {
|
||||
|
@ -675,7 +675,11 @@ inline static void update_stat(void)
|
||||
info.mask |= (1 << INFO_RUN_PROCS);
|
||||
} else if (strncmp(buf, "cpu", 3) == 0) {
|
||||
double delta;
|
||||
idx = isdigit(buf[3]) ? ((int) buf[3]) - 0x2F : 0;
|
||||
if (isdigit(buf[3])) {
|
||||
idx = atoi(&buf[3]);
|
||||
} else {
|
||||
idx = 0;
|
||||
}
|
||||
sscanf(buf, stat_template, &(cpu[idx].cpu_user),
|
||||
&(cpu[idx].cpu_nice), &(cpu[idx].cpu_system),
|
||||
&(cpu[idx].cpu_idle), &(cpu[idx].cpu_iowait),
|
||||
|
Loading…
Reference in New Issue
Block a user