use sizeof(buffer) instead of hardcoded 32 - svkbd - simple virtual keyboard
HTML git clone git://git.suckless.org/svkbd
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 8f6a7b5e42e0614d83bd2a2efe2155cf75cc1eaa
DIR parent 4b5a61b27500e6b33bd560756f744ce7fe2dee29
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 28 Mar 2021 14:58:19 +0200
use sizeof(buffer) instead of hardcoded 32
Diffstat:
M svkbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/svkbd.c b/svkbd.c
@@ -507,7 +507,7 @@ printkey(Key *k, KeySym mod)
char buffer[32];
KeySym ignore;
Status return_status;
- int l = Xutf8LookupString(xic, &event, buffer, 32, &ignore, &return_status);
+ int l = Xutf8LookupString(xic, &event, buffer, sizeof(buffer), &ignore, &return_status);
buffer[l] = '\0';
printdbg("Print buffer: [%s] (length=%d)\n", &buffer, l);
printf("%s", buffer);