aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-12 12:44:33 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-12 12:44:33 +0000
commit2c0d0f0f3cab300d9e4ca8c8bb8c7e9e087b2949 (patch)
treec0bf8073c5060b8ef816bcaad21a120a3378f5db
parent781c2160c3103a10d87e8d4fac474dd0076653e9 (diff)
downloadtermo-2c0d0f0f3cab300d9e4ca8c8bb8c7e9e087b2949.tar.gz
termo-2c0d0f0f3cab300d9e4ca8c8bb8c7e9e087b2949.tar.xz
termo-2c0d0f0f3cab300d9e4ca8c8bb8c7e9e087b2949.zip
Bugfix to 'unknown CSI' case in CSI driver - neater output message to avoid uninitialised ints
-rw-r--r--driver-csi.c18
1 files 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;