From 6cee73195fb5d1d081a1e9ea907cc996d97082de Mon Sep 17 00:00:00 2001 From: erw7 Date: Mon, 27 May 2019 15:57:27 +0900 Subject: vim-patch:8.1.1271: compiler warnings for use of STRNCPY() Problem: Compiler warnings for use of STRNCPY(). (John Marriott) Solution: Use mch_memmove() instead of STRNCPY(). https://github.com/vim/vim/commit/b3de6c4a769986e6eb4e228519a6483d2999ad8f --- src/nvim/search.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nvim/search.c b/src/nvim/search.c index e1eb7200d7..9756faff33 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -1164,9 +1164,9 @@ int do_search( if (utf_iscomposing(utf_ptr2char(p))) { // Use a space to draw the composing char on. msgbuf[1] = ' '; - STRNCPY(msgbuf + 2, p, STRLEN(p)); + memmove(msgbuf + 2, p, STRLEN(p)); } else { - STRNCPY(msgbuf + 1, p, STRLEN(p)); + memmove(msgbuf + 1, p, STRLEN(p)); } if (spats[0].off.line || spats[0].off.end || spats[0].off.off) { p = msgbuf + STRLEN(p) + 1; @@ -4280,7 +4280,7 @@ static void search_stat(int dirc, pos_T *pos, char_u *msgbuf) vim_snprintf(t, STAT_BUF_LEN, "[%d/%d]", cur, cnt); } } - STRNCPY(msgbuf + STRLEN(msgbuf) - STRLEN(t), t, STRLEN(t)); + memmove(msgbuf + STRLEN(msgbuf) - STRLEN(t), t, STRLEN(t)); if (dirc == '?' && cur == 100) { cur = -1; } -- cgit