Skip to content

Commit 22c1056

Browse files
committed
patch 8.1.0023: gcc 8.1 warns for use of strncpy()
Problem: gcc 8.1 warns for use of strncpy(). (John Marriott) Solution: Use mch_memmove() instead of STRNCPY().
1 parent 833093b commit 22c1056

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/memline.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ ml_open(buf_T *buf)
344344
b0p->b0_magic_int = (int)B0_MAGIC_INT;
345345
b0p->b0_magic_short = (short)B0_MAGIC_SHORT;
346346
b0p->b0_magic_char = B0_MAGIC_CHAR;
347-
STRNCPY(b0p->b0_version, "VIM ", 4);
347+
mch_memmove(b0p->b0_version, "VIM ", 4);
348348
STRNCPY(b0p->b0_version + 4, Version, 6);
349349
long_to_char((long)mfp->mf_page_size, b0p->b0_page_size);
350350

src/version.c

+2
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
23,
764766
/**/
765767
22,
766768
/**/

0 commit comments

Comments
 (0)