From 3127a3ee0137f91a64fb59efa49f8fa818ac6be3 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sat, 28 Sep 2013 01:01:30 +0200 Subject: [PATCH] Added missed null byte to string. --- src/main.h | 2 +- src/map.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.h b/src/main.h index 183d5d4..3488252 100644 --- a/src/main.h +++ b/src/main.h @@ -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" diff --git a/src/map.c b/src/map.c index 8a65b72..07dcc3d 100644 --- 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'; -- 2.20.1