diff options
author | erw7 <erw7.github@gmail.com> | 2019-05-27 15:57:27 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2019-06-05 09:55:09 +0900 |
commit | 6cee73195fb5d1d081a1e9ea907cc996d97082de (patch) | |
tree | 0aa6ed43d682a7d13547f244b2df4b6b13a494be | |
parent | 777c2a25ce00f12b2d0dc26d594b1ba7ba10dcc6 (diff) | |
download | rneovim-6cee73195fb5d1d081a1e9ea907cc996d97082de.tar.gz rneovim-6cee73195fb5d1d081a1e9ea907cc996d97082de.tar.bz2 rneovim-6cee73195fb5d1d081a1e9ea907cc996d97082de.zip |
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
-rw-r--r-- | src/nvim/search.c | 6 |
1 files 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; } |