aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mapping.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/mapping.c')
-rw-r--r--src/nvim/mapping.c7
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) {