mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-13 11:15:27 +00:00
Bugfix: sometimes segfaults with cpubar
This commit is contained in:
parent
af55c4afb1
commit
c1e47013ef
@ -1296,7 +1296,7 @@ static struct text_object *construct_text_object(const char *s,
|
|||||||
END OBJ(cached, INFO_BUFFERS)
|
END OBJ(cached, INFO_BUFFERS)
|
||||||
#define SCAN_CPU(__arg, __var) { \
|
#define SCAN_CPU(__arg, __var) { \
|
||||||
int __offset; \
|
int __offset; \
|
||||||
if (__arg && sscanf(__arg, " cpu%u %n", &__var, &__offset)) \
|
if (__arg && sscanf(__arg, " cpu%u %n", &__var, &__offset) == 2) \
|
||||||
__arg += __offset; \
|
__arg += __offset; \
|
||||||
else \
|
else \
|
||||||
__var = 0; \
|
__var = 0; \
|
||||||
|
Loading…
Reference in New Issue
Block a user