commit 8627d0c659f5bb79ba29edd0e7264fb7549e6fac
parent 61e0072c3e6adfc67bafbc84e376cf26bc3680c0
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 16 Oct 2026 13:05:13 +0200
check return value of XCreateIC()
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dmenu.c b/dmenu.c
@@ -698,8 +698,9 @@ setup(void)
if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL)
die("XOpenIM failed: could not open input device");
- xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
- XNClientWindow, win, XNFocusWindow, win, NULL);
+ if ((xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
+ XNClientWindow, win, XNFocusWindow, win, NULL)) == NULL)
+ die("XCreateIC failed: could not obtain input context");
XMapRaised(dpy, win);
if (embed) {