Mercurial > vim
changeset 16535:be24441bf806 v8.1.1271
patch 8.1.1271: compiler warnings for use of STRNCPY()
commit https://github.com/vim/vim/commit/b3de6c4a769986e6eb4e228519a6483d2999ad8f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 5 13:02:28 2019 +0200
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().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 May 2019 13:15:06 +0200 |
parents | 0e30cd01cd16 |
children | 49cd31fd7dd0 |
files | src/search.c src/version.c |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/search.c +++ b/src/search.c @@ -1415,10 +1415,10 @@ do_search( { // Use a space to draw the composing char on. msgbuf[1] = ' '; - STRNCPY(msgbuf + 2, p, STRLEN(p)); + mch_memmove(msgbuf + 2, p, STRLEN(p)); } else - STRNCPY(msgbuf + 1, p, STRLEN(p)); + mch_memmove(msgbuf + 1, p, STRLEN(p)); if (spats[0].off.line || spats[0].off.end || spats[0].off.off) { p = msgbuf + STRLEN(p) + 1; @@ -5006,7 +5006,7 @@ search_stat( else vim_snprintf(t, STAT_BUF_LEN, "[%d/%d]", cur, cnt); } - STRNCPY(msgbuf + STRLEN(msgbuf) - STRLEN(t), t, STRLEN(t)); + mch_memmove(msgbuf + STRLEN(msgbuf) - STRLEN(t), t, STRLEN(t)); if (dirc == '?' && cur == 100) cur = -1;