summaryrefslogtreecommitdiff
path: root/src/message.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-06-29 21:16:58 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-29 21:16:58 +0100
commit083692d598139228e101b8c521aaef7bcf256e9a (patch)
tree237ad8cec0b948b2793e040fa7b8957e0f97fbd8 /src/message.c
parent83e11800cc3775de3135ac7d823137c8c1e87fa1 (diff)
downloadvim-git-083692d598139228e101b8c521aaef7bcf256e9a.tar.gz
patch 9.0.0009: going past the end of a menu item with only modifierv9.0.0009
Problem: Going past the end of a menu item with only modifier. Solution: Check for NUL.
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/message.c b/src/message.c
index 02380e917..becb2804d 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1820,8 +1820,8 @@ str2special(
*sp = str + 1;
}
else
- // single-byte character or illegal byte
- *sp = str + 1;
+ // single-byte character, NUL or illegal byte
+ *sp = str + (*str == NUL ? 0 : 1);
// Make special keys and C0 control characters in <> form, also <M-Space>.
// Use <Space> only for lhs of a mapping.