aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-08-28 13:39:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-08-28 13:39:17 +0000
commitacf62bdda5416b845a4ad06e2bf4a75479e2b3af (patch)
treee10d9c92a69c8ea65465245f2e15db6f0877ecd3
parentcsi: disable debug logging (diff)
csi: multi-cursor: ensure 'len' is initialized
-rw-r--r--csi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/csi.c b/csi.c
index 962951d8..489397a2 100644
--- a/csi.c
+++ b/csi.c
@@ -11,7 +11,7 @@
#include <sys/timerfd.h>
#define LOG_MODULE "csi"
-#define LOG_ENABLE_DBG 0
+#define LOG_ENABLE_DBG 1
#include "log.h"
#include "char32.h"
#include "config.h"
@@ -2445,7 +2445,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
term_to_slave(term, "\033[>101", 7);
char reply[64];
- int len;
+ int len = 0;
switch (term->multi_cursor.text_color_source) {
case MULTI_CURSOR_COLOR_PRIMARY:
@@ -2476,6 +2476,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
term_to_slave(term, reply, len);
+ len = 0;
switch (term->multi_cursor.cursor_color_source) {
case MULTI_CURSOR_COLOR_PRIMARY:
len = snprintf(reply, sizeof(reply), ";40:%u", MULTI_CURSOR_COLOR_PRIMARY);