aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/keymap.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2021-09-11 12:12:59 -0700
committerGitHub <noreply@github.com>2021-09-11 12:12:59 -0700
commit413e86869ef147431a78946562c125938b41f533 (patch)
tree4499c79a08aa7d0d3815c577f3ad98fcbdfe5b0b /src/nvim/keymap.c
parente31652879e4ecfc63b450626209d09df79336de0 (diff)
parent7175efb518d09aad59f7917c15b7c9752e9e320e (diff)
downloadrneovim-413e86869ef147431a78946562c125938b41f533.tar.gz
rneovim-413e86869ef147431a78946562c125938b41f533.tar.bz2
rneovim-413e86869ef147431a78946562c125938b41f533.zip
Merge #14611 from seandewar/vim-8.1.1116
vim-patch:8.1.{1116,1188,1190,1355,1722,2035,2036,2038,2043},8.2.{0886,2309}
Diffstat (limited to 'src/nvim/keymap.c')
-rw-r--r--src/nvim/keymap.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c
index 277b9ade89..c6966ff9fa 100644
--- a/src/nvim/keymap.c
+++ b/src/nvim/keymap.c
@@ -628,7 +628,11 @@ int find_special_key(const char_u **srcp, const size_t src_len, int *const modp,
if (end - bp > 3 && bp[0] == 't' && bp[1] == '_') {
bp += 3; // skip t_xx, xx may be '-' or '>'
} else if (end - bp > 4 && STRNICMP(bp, "char-", 5) == 0) {
- vim_str2nr(bp + 5, NULL, &l, STR2NR_ALL, NULL, NULL, 0);
+ vim_str2nr(bp + 5, NULL, &l, STR2NR_ALL, NULL, NULL, 0, true);
+ if (l == 0) {
+ EMSG(_(e_invarg));
+ return 0;
+ }
bp += l + 5;
break;
}
@@ -654,7 +658,11 @@ int find_special_key(const char_u **srcp, const size_t src_len, int *const modp,
if (STRNICMP(last_dash + 1, "char-", 5) == 0
&& ascii_isdigit(last_dash[6])) {
// <Char-123> or <Char-033> or <Char-0x33>
- vim_str2nr(last_dash + 6, NULL, NULL, STR2NR_ALL, NULL, &n, 0);
+ vim_str2nr(last_dash + 6, NULL, &l, STR2NR_ALL, NULL, &n, 0, true);
+ if (l == 0) {
+ EMSG(_(e_invarg));
+ return 0;
+ }
key = (int)n;
} else {
int off = 1;