mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 12:27:52 +00:00
Fix bug in $scroll (if there were only 2 args the 2nd couldn't be numerical)
This commit is contained in:
parent
e905c7d4f1
commit
85deafa500
@ -2945,8 +2945,12 @@ static struct text_object *construct_text_object(const char *s,
|
||||
|
||||
obj->data.scroll.step = 1;
|
||||
if (arg && sscanf(arg, "%u %n", &obj->data.scroll.show, &n1) > 0) {
|
||||
if (sscanf(arg + n1, "%u %n", &obj->data.scroll.step, &n2) > 0)
|
||||
sscanf(arg + n1, "%u %n", &obj->data.scroll.step, &n2);
|
||||
if(*(arg + n1 + n2)) {
|
||||
n1 += n2;
|
||||
}else{
|
||||
obj->data.scroll.step = 1;
|
||||
}
|
||||
obj->data.scroll.text = strndup(arg + n1, text_buffer_size);
|
||||
obj->data.scroll.start = 0;
|
||||
obj->sub = malloc(sizeof(struct text_object));
|
||||
|
Loading…
Reference in New Issue
Block a user