From 5b9c18164ba840292706c9c97f92d775852e53a9 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 7 Feb 2024 10:31:28 +1000 Subject: [PATCH 1/2] interactive-evdev: reduce the space allocated 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 0e6364809..c4f357467 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 ", (int)MAX(strlen(s), XKB_KEYSYM_NAME_MAX_SIZE), s); } printf("] "); From eebdeaeed88d535b362e0cd92c0a2447b200972d Mon Sep 17 00:00:00 2001 From: Wismill Date: Thu, 8 Feb 2024 11:06:19 +0100 Subject: [PATCH 2/2] Simplify --- 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 c4f357467..210db5219 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)MAX(strlen(s), XKB_KEYSYM_NAME_MAX_SIZE), s); + printf("%-*s ", XKB_KEYSYM_NAME_MAX_SIZE, s); } printf("] ");