From: Timo Hirvonen Date: Tue, 05 Feb 2008 19:18:21 GMT Subject: [PATCH] Fix parsing numeric color values Message-ID: <20080205211821.e4a15194.tihirvon@gmail.com> In-Reply-To: <20080205205856.76a7cd45.tihirvon@gmail.com> Fix bug reported by Chris Larson . Numeric color only worked if it was at end of line. --- color.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/color.c b/color.c index 7f66c29..3c999c3 100644 --- a/color.c +++ b/color.c @@ -17,7 +17,7 @@ static int parse_color(const char *name, int len) return i - 1; } i = strtol(name, &end, 10); - if (*name && !*end && i >= -1 && i <= 255) + if (*name && (!*end || isspace(*end)) && i >= -1 && i <= 255) return i; return -2; } -- 1.5.4.1134.ge34cf-dirty