From 85deafa50050750d04c05a9343f5b4e4f882d893 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sat, 18 Jul 2009 01:15:09 +0200 Subject: [PATCH] Fix bug in $scroll (if there were only 2 args the 2nd couldn't be numerical) --- src/conky.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conky.c b/src/conky.c index 5f026112..8f47d295 100644 --- a/src/conky.c +++ b/src/conky.c @@ -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));