[hackers] [dmenu] xim: check for corner cases || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Mon, 17 Oct 2011 02:19:45 +0200 (CEST)

changeset: 449:93cf81e50cf2
branch: xim
tag: tip
parent: 445:67dffe9c4849
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Mon Oct 17 01:18:57 2011 +0100
files: dmenu.c
description:
xim: check for corner cases


diff -r 67dffe9c4849 -r 93cf81e50cf2 dmenu.c
--- a/dmenu.c Sun Oct 16 17:21:33 2011 +0100
+++ b/dmenu.c Mon Oct 17 01:18:57 2011 +0100
_AT_@ -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;
 
_AT_@ -549,10 +551,10 @@
                             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);
Received on Mon Oct 17 2011 - 02:19:45 CEST

This archive was generated by hypermail 2.3.0 : Mon Oct 17 2011 - 02:24:06 CEST