1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-05 21:07:52 +00:00

Fix bug in $scroll (if there were only 2 args the 2nd couldn't be numerical)

This commit is contained in:
Nikolas Garofil 2009-07-18 01:15:09 +02:00
parent e905c7d4f1
commit 85deafa500

View File

@ -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));