From: Daniel Carl Date: Fri, 27 Sep 2013 23:01:30 +0000 (+0200) Subject: Added missed null byte to string. X-Git-Url: https://git.owens.tech/wrapped.html/wrapped.html/git?a=commitdiff_plain;h=3127a3ee0137f91a64fb59efa49f8fa818ac6be3;p=vimb.git Added missed null byte to string. --- 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';