From 2c0d0f0f3cab300d9e4ca8c8bb8c7e9e087b2949 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Wed, 12 Nov 2008 12:44:33 +0000 Subject: Bugfix to 'unknown CSI' case in CSI driver - neater output message to avoid uninitialised ints --- driver-csi.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/driver-csi.c b/driver-csi.c index 8963f20..501e5d1 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -240,8 +240,22 @@ static termkey_result getkey_csi(termkey_t *tk, termkey_csi *csi, size_t introle key->modifiers &= ~(csi->csi_ss3s[cmd - 0x40].modifier_mask); key->modifiers |= csi->csi_ss3s[cmd - 0x40].modifier_set; - if(key->code.sym == TERMKEY_SYM_UNKNOWN) - fprintf(stderr, "CSI arg1=%ld arg2=%ld cmd=%c\n", arg[0], arg[1], cmd); + if(key->code.sym == TERMKEY_SYM_UNKNOWN) { + switch(args) { + case 1: + fprintf(stderr, "CSI arg1=%ld cmd=%c\n", arg[0], cmd); + break; + case 2: + fprintf(stderr, "CSI arg1=%ld arg2=%ld cmd=%c\n", arg[0], arg[1], cmd); + break; + case 3: + fprintf(stderr, "CSI arg1=%ld arg2=%ld arg3=%ld cmd=%c\n", arg[0], arg[1], arg[2], cmd); + break; + default: + fprintf(stderr, "CSI arg1=%ld arg2=%ld arg3=%ld ... args=%d cmd=%c\n", arg[0], arg[1], arg[2], args, cmd); + break; + } + } } return TERMKEY_RES_KEY; -- cgit v1.2.3-70-g09d2