aboutsummaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorokan2019-03-04 13:33:39 +0000
committerokan2019-03-04 13:33:39 +0000
commit0108eead09f301176b49ca9a47cf32d26714f2a9 (patch)
treea850852e961fd326c986cbccbd887dfdd0c0af39 /conf.c
parente1d11722a750db804d9c601e9bf771ec5b8ec868 (diff)
downloadcwm-0108eead09f301176b49ca9a47cf32d26714f2a9.tar.gz
simplify xftcolor config
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c9
1 files changed, 3 insertions, 6 deletions
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 <sys/types.h>
@@ -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]);