From dd3e2140037a9a908eaa1813c91d5e5938025366 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 8 Feb 2024 20:15:22 +1000 Subject: [PATCH] interactive-evdev: reduce the space allocated for keysyms (#443) * interactive-evdev: reduce the printed space used for keysyms In commit 8cca3a7bfb185876994d6ec3d25cda88e5640a4d the buffer for the keysym was extended to accommodate for up to XKB_COMPOSE_MAX_STRING_SIZE bytes. This caused the printf to expand to the same width for the keysym alone, making the output less useful. Drop this back down to the same width it was before. --- tools/tools-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools-common.c b/tools/tools-common.c index 0e63648..210db52 100644 --- a/tools/tools-common.c +++ b/tools/tools-common.c @@ -200,7 +200,7 @@ tools_print_keycode_state(char *prefix, printf("keysyms [ "); for (int i = 0; i < nsyms; i++) { xkb_keysym_get_name(syms[i], s, sizeof(s)); - printf("%-*s ", (int) sizeof(s), s); + printf("%-*s ", XKB_KEYSYM_NAME_MAX_SIZE, s); } printf("] ");