]> granicus.if.org Git - vim/commitdiff
patch 8.1.1271: compiler warnings for use of STRNCPY() v8.1.1271
authorBram Moolenaar <Bram@vim.org>
Sun, 5 May 2019 11:02:28 +0000 (13:02 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 5 May 2019 11:02:28 +0000 (13:02 +0200)
Problem:    Compiler warnings for use of STRNCPY(). (John Marriott)
Solution:   Use mch_memmove() instead of STRNCPY().

src/search.c
src/version.c

index 3df3ca61d9a51d61263f4b98e285126de052dd65..1fa52b443cfddb22a4b6f31284774774a25e281e 100644 (file)
@@ -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;
 
index 8dee65efacbd3a1de559d669b04ed4cc7c8baafc..0fa3c41194615c3477d32bbf79ec73f8630a8905 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1271,
 /**/
     1270,
 /**/