fixed print output mode - svkbd - simple virtual keyboard
HTML git clone git://git.suckless.org/svkbd
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 869a4328c970b4cfbfcf86ab535f68caaa8a9e00
DIR parent 9b5ebd84470cc5875bcd3a3f32f72a5d957815cd
HTML Author: Maarten van Gompel <proycon@anaproy.nl>
Date: Mon, 8 Mar 2021 22:36:30 +0100
fixed print output mode
Diffstat:
M svkbd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
DIR diff --git a/svkbd.c b/svkbd.c
@@ -501,11 +501,13 @@ printkey(Key *k, KeySym mod) {
char buffer[32];
KeySym ignore;
Status return_status;
- Xutf8LookupString(xic, &event, buffer, 32, &ignore, &return_status);
+ int l = Xutf8LookupString(xic, &event, buffer, 32, &ignore, &return_status);
+ buffer[l] = '\0';
+ if (debug) printdbg("Print buffer: [%s] (length=%d)\n", &buffer, l);
+ printf("%s", buffer);
XDestroyIC(xic);
XCloseIM(xim);
- printf("%s", buffer);
}
void