commit 0af08ef36868e551a4eb867537ef02522cc9d8a9
parent ea1c603be48f84dc5a848fa258759c955d55affb
Author: Mahdi Mirzade <[email protected]>
Date: Wed, 26 Oct 2022 14:49:14 +0330
dmenu: small XmbLookupString code improvements
* Increase the length of composed strings to the same limit as st (32 to 64 bytes).
* Initialize ksym to NoSymbol to be safe: currently this is not an issue though.
* Add comments to clarify the return values of XmbLookupString a bit.
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dmenu.c b/dmenu.c
@@ -440,19 +440,19 @@ movewordedge(int dir)
static void
keypress(XKeyEvent *ev)
{
- char buf[32];
+ char buf[64];
int len;
- KeySym ksym;
+ KeySym ksym = NoSymbol;
Status status;
len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
switch (status) {
default: /* XLookupNone, XBufferOverflow */
return;
- case XLookupChars:
+ case XLookupChars: /* composed string from input method */
goto insert;
case XLookupKeySym:
- case XLookupBoth:
+ case XLookupBoth: /* a KeySym and a string are returned: use keysym */
break;
}