From b42a7a18538d9f3c7871b38602728f9d39251514 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 6 Apr 2022 13:37:32 -0400 Subject: [PATCH] Bugfix for bindings error --- bb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bb.c b/bb.c index dac1853..05f8f2b 100644 --- a/bb.c +++ b/bb.c @@ -684,7 +684,8 @@ static void run_bbcmd(bb_t *bb, const char *cmd) if (b->key == keyval) { delete((char**)&b->description); delete((char**)&b->script); - memmove(b, b+1, (size_t)(&bindings[LEN(bindings)] - (b+1))); + int i = (int)(b - bindings); + memmove(&bindings[i], &bindings[i+1], sizeof(binding_t)*(LEN(bindings) - i - 1)); memset(&bindings[LEN(bindings)-1], 0, sizeof(binding_t)); } }