svkbd

simple virtual keyboard
git clone git://git.suckless.org/svkbd
Log | Files | Refs | README | LICENSE

commit 869a4328c970b4cfbfcf86ab535f68caaa8a9e00
parent 9b5ebd84470cc5875bcd3a3f32f72a5d957815cd
Author: Maarten van Gompel <proycon@anaproy.nl>
Date:   Mon,  8 Mar 2021 22:36:30 +0100

fixed print output mode

Diffstat:
Msvkbd.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

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