From 0c0551b8bffd9a978247a9c6b98e84a9bdd6f76c Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 4 Mar 2019 13:33:39 +0000 Subject: simplify xftcolor config --- conf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/conf.c b/conf.c index d6b0dd1..d600728 100644 --- a/conf.c +++ b/conf.c @@ -493,11 +493,8 @@ conf_screen(struct screen_ctx *sc) warnx("XftColorAllocValue: %s", Conf.color[i]); break; } - if (XftColorAllocName(X_Dpy, sc->visual, sc->colormap, - Conf.color[i], &xc)) { - sc->xftcolor[i] = xc; - XftColorFree(X_Dpy, sc->visual, sc->colormap, &xc); - } else { + if (!XftColorAllocName(X_Dpy, sc->visual, sc->colormap, + Conf.color[i], &sc->xftcolor[i])) { warnx("XftColorAllocName: %s", Conf.color[i]); XftColorAllocName(X_Dpy, sc->visual, sc->colormap, color_binds[i], &sc->xftcolor[i]); -- cgit 1.4.1