diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
commit | ff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch) | |
tree | 729bbcb92231538fa61dab6c3d890b025484b7f5 /src/nvim/mapping.c | |
parent | 376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff) | |
parent | 28c04948a1c887a1cc0cb64de79fa32631700466 (diff) | |
download | rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2 rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'src/nvim/mapping.c')
-rw-r--r-- | src/nvim/mapping.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c index 43a4c10ea7..9320390d68 100644 --- a/src/nvim/mapping.c +++ b/src/nvim/mapping.c @@ -347,7 +347,7 @@ static void set_maparg_rhs(const char *const orig_rhs, const size_t orig_rhs_len if (rhs_lua == LUA_NOREF) { mapargs->orig_rhs_len = orig_rhs_len; mapargs->orig_rhs = xcalloc(mapargs->orig_rhs_len + 1, sizeof(char)); - xstrlcpy(mapargs->orig_rhs, orig_rhs, mapargs->orig_rhs_len + 1); + xmemcpyz(mapargs->orig_rhs, orig_rhs, mapargs->orig_rhs_len); if (STRICMP(orig_rhs, "<nop>") == 0) { // "<Nop>" means nothing mapargs->rhs = xcalloc(1, sizeof(char)); // single NUL-char mapargs->rhs_len = 0; @@ -477,7 +477,7 @@ static int str_to_mapargs(const char *strargs, bool is_unmap, MapArguments *mapa return 1; } char lhs_to_replace[256]; - xstrlcpy(lhs_to_replace, to_parse, orig_lhs_len + 1); + xmemcpyz(lhs_to_replace, to_parse, orig_lhs_len); size_t orig_rhs_len = strlen(rhs_start); if (!set_maparg_lhs_rhs(lhs_to_replace, orig_lhs_len, @@ -1812,8 +1812,7 @@ int makemap(FILE *fd, buf_T *buf) iemsg(_("E228: makemap: Illegal mode")); return FAIL; } - do { - // do this twice if c2 is set, 3 times with c3 */ + do { // do this twice if c2 is set, 3 times with c3 // When outputting <> form, need to make sure that 'cpo' // is set to the Vim default. if (!did_cpo) { |