all repos — dmenu @ 24565608cbf8572211a4a1b3fe7bbe1cf0c4fbbd

my build of dmenu

xim: check for corner cases
Connor Lane Smith cls@lubutu.com
Mon, 17 Oct 2011 01:18:57 +0100
commit

24565608cbf8572211a4a1b3fe7bbe1cf0c4fbbd

parent

c8f0a3763843966ad480e22b18fe61ff54dc9a39

1 files changed, 6 insertions(+), 4 deletions(-)

jump to
M dmenu.cdmenu.c

@@ -230,11 +230,13 @@

void keypress(XKeyEvent *ev) { char buf[32]; - KeySym ksym; int len; + KeySym ksym = NoSymbol; Status status; - len = XmbLookupString(xic, ev, buf, sizeof(buf), &ksym, &status); + len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status); + if(status == XBufferOverflow) + return; if(ev->state & ControlMask) { KeySym lower, upper;

@@ -549,10 +551,10 @@ DefaultDepth(dc->dpy, screen), CopyFromParent,

DefaultVisual(dc->dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &swa); - /* input methods */ + /* input methods */ xim = XOpenIM(dc->dpy, NULL, NULL, NULL); xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, - XNClientWindow, win, XNFocusWindow, win, NULL); + XNClientWindow, win, XNFocusWindow, win, NULL); XMapRaised(dc->dpy, win); resizedc(dc, mw, mh);