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); + } ;