From 361b7e3fbba136c235cc597017195ede1cd53e9f Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Mon, 28 Oct 2024 19:08:22 +0000 Subject: [PATCH] PrintInfo: don't clobber window-bindings When printing out window-specific bindings, don't ignore them. --- fvwm/bindings.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fvwm/bindings.c b/fvwm/bindings.c index 99486dfec..e6238dd1c 100644 --- a/fvwm/bindings.c +++ b/fvwm/bindings.c @@ -543,23 +543,24 @@ static void binding_cmd(F_CMD_ARGS, binding_t type) void print_bindings(void) { Binding *b; - char kbinding[4096], pbinding[4096]; + char kbinding[4096], pbinding[4096], type[4096]; fvwm_debug(__func__, "Current list of bindings:\n\n"); for (b = Scr.AllBindings; b != NULL; b = b->NextBinding) { + memset(&kbinding, '\0', sizeof kbinding); switch (b->type) { case BIND_KEYPRESS: - snprintf(kbinding, sizeof(kbinding), "%s ", "Key"); + snprintf(type, sizeof(type), "%s ", "Key"); break; case BIND_PKEYPRESS: - snprintf(kbinding, sizeof(kbinding), "%s ", + snprintf(type, sizeof(type), "%s ", "PointerKey"); break; case BIND_BUTTONPRESS: case BIND_BUTTONRELEASE: - snprintf(kbinding, sizeof(kbinding), "%s ", "Mouse"); + snprintf(type, sizeof(type), "%s ", "Mouse"); break; default: fvwm_debug(__func__, "invalid binding type %d", b->type); @@ -596,7 +597,7 @@ void print_bindings(void) free(mod_string); free(context_string); } - fvwm_debug(__func__, "%s %s", kbinding, pbinding); + fvwm_debug(__func__, "%s %s %s", type, kbinding, pbinding); } return;