mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18: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:
@@ -3854,7 +3854,7 @@ static char_u *replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep)
|
||||
ptr = new_cmdline;
|
||||
while ((pos = (char_u *)strstr((char *)program, "$*")) != NULL) {
|
||||
i = (int)(pos - program);
|
||||
STRNCPY(ptr, program, i);
|
||||
memcpy(ptr, program, i);
|
||||
STRCPY(ptr += i, p);
|
||||
ptr += len;
|
||||
program = pos + 2;
|
||||
|
Reference in New Issue
Block a user