From 3c6ec1995d8ec4d8d5da7ca81d15adfdb08086aa Mon Sep 17 00:00:00 2001 From: Christoph Lohmann <20h@r-36.net> Date: Tue, 11 Dec 2012 08:32:08 +0100 Subject: Adding error checks for XCreateIC and XOpenIM. --- st.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'st.c') diff --git a/st.c b/st.c index 42061b9..da5f78d 100644 --- a/st.c +++ b/st.c @@ -2431,9 +2431,13 @@ xinit(void) { /* input methods */ xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); + if(xw.xim == NULL) + die("XOpenIM failed. Could not open input device.\n"); xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, xw.win, XNFocusWindow, xw.win, NULL); + if(xw.xic == NULL) + die("XCreateIC failed. Could not obtain input method.\n"); /* white cursor, black outline */ cursor = XCreateFontCursor(xw.dpy, XC_xterm); -- cgit v1.2.3