diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-01-26 14:33:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-26 14:33:03 +0100 |
commit | 59fd0c4132f06a76c460f46ec93fce7b7f1d6f08 (patch) | |
tree | 0a6eaf861fa7406c9cd06ffd61dc37e84b051975 /src/nvim/syntax.c | |
parent | f78982620a48dc76bbd3635300650d06ced24aab (diff) | |
download | rneovim-59fd0c4132f06a76c460f46ec93fce7b7f1d6f08.tar.gz rneovim-59fd0c4132f06a76c460f46ec93fce7b7f1d6f08.tar.bz2 rneovim-59fd0c4132f06a76c460f46ec93fce7b7f1d6f08.zip |
refactor: Remove strncpy/STRNCPY. (#6008)
Closes #731
References #851
Note: This does not remove some intentional legacy usages of strncpy.
- memcpy isn't equivalent because it doesn't check the string
length of `src`, and doesn't zero-out the remainder of `dst`.
- xstrlcpy isn't equivalent because it doesn't zero-out the
remainder of `dst`. Some Vim logic depends on that (e.g.
ex_append which calls vim_strnsave).
Helped-by: Douglas Schneider <ds3@ualberta.ca>
Helped-by: oni-link <knil.ino@gmail.com>
Helped-by: James McCoy <jamessan@jamessan.com>
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 5bfc655645..37e5542dad 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -3377,7 +3377,7 @@ static void syn_cmd_onoff(exarg_T *eap, char *name) eap->nextcmd = check_nextcmd(eap->arg); if (!eap->skip) { char buf[100]; - strncpy(buf, "so ", 4); + memcpy(buf, "so ", 4); vim_snprintf(buf + 3, sizeof(buf) - 3, SYNTAX_FNAME, name); do_cmdline_cmd(buf); } |