Added missed null byte to string.
authorDaniel Carl <danielcarl@gmx.de>
Fri, 27 Sep 2013 23:01:30 +0000 (01:01 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 27 Sep 2013 23:01:30 +0000 (01:01 +0200)
src/main.h
src/map.c

index 183d5d4..3488252 100644 (file)
@@ -41,7 +41,7 @@
 
 #define CTRL(x)      ((x) ^ 0x40)
 /* check if the char x is a char with CTRL like ^C */
-#define IS_CTRL(x)   (((unsigned char)x) <= 32)
+#define IS_CTRL(x)   (((unsigned char)x) <= 0x1f)
 #define CSI          0x9b   /* Control Sequence Introducer */
 #define CSI_STR      "\233"
 
index 8a65b72..07dcc3d 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -491,7 +491,7 @@ static void showcmd(char *keys, int keylen)
 
     /* if we get a keylen > 1 this means we have a better match for a previous
      * ambiguous key sequence and have to remove the previous one before */
-    if (!keylen || keylen > 1) {
+    if (keylen != 1) {
         map.showbuf[0] = '\0';
     }
     /* show the most significant last chars in the statusbar if they don't
@@ -522,6 +522,7 @@ static char *transchar(char c)
         map.transchar[2] = '\0';
     } else if ((c & 0xff) == CSI) {
         map.transchar[0] = '~';
+        map.transchar[1] = '\0';
     } else {
         map.transchar[0] = c;
         map.transchar[1] = '\0';