aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lohmann2012-12-11 08:32:08 +0100
committerChristoph Lohmann2012-12-11 08:32:08 +0100
commitcee769c241ea65e1ef89973cbee8a0f0df0f3cf7 (patch)
treef61cd722a5dd247b6eb0199055534dc66658c3ea
parentdb7cff01d65269d6e4fdf12cd384359130052387 (diff)
downloadaur-cee769c241ea65e1ef89973cbee8a0f0df0f3cf7.tar.gz
Adding error checks for XCreateIC and XOpenIM.
-rw-r--r--TODO1
-rw-r--r--st.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/TODO b/TODO
index b1af77462e4b..a4cfeee71fe4 100644
--- a/TODO
+++ b/TODO
@@ -17,7 +17,6 @@ code & interface
bugs
----
-* handle XOpenMI() errors
* fix shift up/down (shift selection in emacs)
* fix selection paste for xatom STRING
* fix umlaut handling in settitle
diff --git a/st.c b/st.c
index 42061b9809a3..da5f78d58c37 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);