From b5ada0b39fc49d0f6c97969a43c50ef4a5ab0aaa Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Mon, 1 Aug 2005 09:23:39 +0000 Subject: [PATCH] oops git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@40 7f574dfc-610e-0410-a909-a81674777703 --- conky.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) 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; } }