From f72161d0c209317f33e0d14a6e6fd807db8221e8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 1 Oct 2009 12:29:27 +0200 Subject: [PATCH] Bugfix: parser: Correctly generate colorpixels from hex codes --- src/cfgparse.y | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cfgparse.y b/src/cfgparse.y index 8a358454..4cb82998 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -493,7 +493,14 @@ color: ; colorpixel: - '#' HEX { $$ = get_colorpixel(global_conn, $2); } + '#' HEX + { + char *hex; + if (asprintf(&hex, "#%s", $2) == -1) + die("asprintf()"); + $$ = get_colorpixel(global_conn, hex); + free(hex); + } ; -- 2.39.5