diff --git a/conky.c b/conky.c index d3260003..83fb9c7b 100644 --- a/conky.c +++ b/conky.c @@ -354,18 +354,14 @@ static const char *scan_graph(const char *args, int *w, int *h, unsigned int *fi *last_colour = 0; /* graph's argument is either height or height,width */ if (args) { - if (sscanf(args, "%x %x", first_colour, last_colour) < 2) { - if (sscanf(args, "%d,%d", h, w) < 2) { - if (sscanf(args, "%*s %x %x", first_colour, last_colour) < 2) { - if (sscanf(args, "%*s %d,%d", h, w) < 2) { - if (sscanf(args, "%d,%d %x %x", h, w, first_colour, last_colour) < 4) { - if (sscanf(args, "%*s %x %x", first_colour, last_colour) < 2) { - sscanf(args, "%*s %d,%d %x %x", h, w, first_colour, last_colour); - } - } - } - } + if (sscanf(args, "%*s %d,%d %x %x", h, w, first_colour, last_colour) < 4) { + if (sscanf(args, "%*s %x %x", first_colour, last_colour) < 2) { + sscanf(args, "%x %x", first_colour, last_colour); + *w = 0; + *h = 25; } + *w = 0; + *h = 25; } }