mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 02:08:17 +00:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user