]> granicus.if.org Git - vim/commitdiff
patch 8.1.0023: gcc 8.1 warns for use of strncpy() v8.1.0023
authorBram Moolenaar <Bram@vim.org>
Sat, 26 May 2018 15:35:27 +0000 (17:35 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 26 May 2018 15:35:27 +0000 (17:35 +0200)
Problem:    gcc 8.1 warns for use of strncpy(). (John Marriott)
Solution:   Use mch_memmove() instead of STRNCPY().

src/memline.c
src/version.c

index 7d6cefaa028d2471d4b462a6125cdd92edf1df6b..be395fce6b86e2abf95c751f9060527ce6ba9b68 100644 (file)
@@ -344,7 +344,7 @@ ml_open(buf_T *buf)
     b0p->b0_magic_int = (int)B0_MAGIC_INT;
     b0p->b0_magic_short = (short)B0_MAGIC_SHORT;
     b0p->b0_magic_char = B0_MAGIC_CHAR;
-    STRNCPY(b0p->b0_version, "VIM ", 4);
+    mch_memmove(b0p->b0_version, "VIM ", 4);
     STRNCPY(b0p->b0_version + 4, Version, 6);
     long_to_char((long)mfp->mf_page_size, b0p->b0_page_size);
 
index 0cfe61a04a306e09158cfae04e2656b1035bba17..69e20cb1d6e4ff3ec5f23de7bca4575cab1bba84 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    23,
 /**/
     22,
 /**/