Mercurial > vim
changeset 14011:8631b54ae2a2 v8.1.0023
patch 8.1.0023: gcc 8.1 warns for use of strncpy()
commit https://github.com/vim/vim/commit/22c105640cdef25d98390f973d2ed53dd9039f6e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 26 17:35:27 2018 +0200
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().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 26 May 2018 17:45:06 +0200 |
parents | 0a4514f40d19 |
children | e1050685ad5c |
files | src/memline.c src/version.c |
diffstat | 2 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/memline.c +++ b/src/memline.c @@ -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);