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("] ");