Skip to content

Commit

Permalink
patch 8.1.0023: gcc 8.1 warns for use of strncpy()
Browse files Browse the repository at this point in the history
Problem:    gcc 8.1 warns for use of strncpy(). (John Marriott)
Solution:   Use mch_memmove() instead of STRNCPY().
  • Loading branch information
brammool committed May 26, 2018
1 parent 833093b commit 22c1056
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/memline.c
Expand Up @@ -344,7 +344,7 @@ ml_open(buf_T *buf)
b0p->b0_magic_int = (int)B0_MAGIC_INT; b0p->b0_magic_int = (int)B0_MAGIC_INT;
b0p->b0_magic_short = (short)B0_MAGIC_SHORT; b0p->b0_magic_short = (short)B0_MAGIC_SHORT;
b0p->b0_magic_char = B0_MAGIC_CHAR; 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); STRNCPY(b0p->b0_version + 4, Version, 6);
long_to_char((long)mfp->mf_page_size, b0p->b0_page_size); long_to_char((long)mfp->mf_page_size, b0p->b0_page_size);


Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =


static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
23,
/**/ /**/
22, 22,
/**/ /**/
Expand Down

0 comments on commit 22c1056

Please sign in to comment.