From 0108eead09f301176b49ca9a47cf32d26714f2a9 Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 4 Mar 2019 13:33:39 +0000 Subject: simplify xftcolor config --- conf.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index e1ff8b9..fa068cd 100644 --- a/conf.c +++ b/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.246 2019/03/01 14:32:01 okan Exp $ + * $OpenBSD: conf.c,v 1.247 2019/03/04 13:33:39 okan Exp $ */ #include @@ -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 v1.2.3-2-gb3c3