diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 46f70cf23e..4f1cd5d526 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -2222,7 +2222,7 @@ int op_change(oparg_T *oap) /* Subsequent calls to ml_get() flush the firstline data - take a * copy of the inserted text. */ ins_text = (char_u *) xmalloc((size_t)(ins_len + 1)); - vim_strncpy(ins_text, firstline + bd.textcol, (size_t)ins_len); + STRLCPY(ins_text, firstline + bd.textcol, ins_len + 1); for (linenr = oap->start.lnum + 1; linenr <= oap->end.lnum; linenr++) { block_prep(oap, &bd, linenr, TRUE);