projects
/
monky
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbb2675
)
Fix sigsegv if cpu_usage has not yet been populated
author
Cesare Tirabassi
<norsetto@ubuntu.com>
Tue, 5 Jan 2010 16:08:20 +0000
(17:08 +0100)
committer
Cesare Tirabassi
<norsetto@ubuntu.com>
Tue, 5 Jan 2010 16:08:20 +0000
(17:08 +0100)
src/conky.c
patch
|
blob
|
history
diff --git
a/src/conky.c
b/src/conky.c
index
8eab0e6
..
fdc5996
100644
(file)
--- a/
src/conky.c
+++ b/
src/conky.c
@@
-899,8
+899,10
@@
void generate_text_internal(char *p, int p_max_size,
obj->data.i, info.cpu_count);
CRIT_ERR(NULL, NULL, "attempting to use more CPUs than you have!");
}
- percent_print(p, p_max_size,
+ if (cur->cpu_usage) {
+ percent_print(p, p_max_size,
round_to_int(cur->cpu_usage[obj->data.i] * 100.0));
+ }
}
OBJ(cpugauge)
new_gauge(obj, p, p_max_size, round_to_int(cur->cpu_usage[obj->data.i] * 255.0));