mirror of
https://github.com/neovim/neovim.git
synced 2025-11-24 19:20:39 +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:
@@ -3847,13 +3847,11 @@ static int ins_compl_get_exp(pos_T *ini)
|
||||
if ((compl_cont_status & CONT_ADDING)
|
||||
&& len == compl_length) {
|
||||
if (pos->lnum < ins_buf->b_ml.ml_line_count) {
|
||||
/* Try next line, if any. the new word will be
|
||||
* "join" as if the normal command "J" was used.
|
||||
* IOSIZE is always greater than
|
||||
* compl_length, so the next STRNCPY always
|
||||
* works -- Acevedo */
|
||||
// Try next line, if any. the new word will be "join" as if the
|
||||
// normal command "J" was used. IOSIZE is always greater than
|
||||
// compl_length, so the next STRNCPY always works -- Acevedo
|
||||
STRNCPY(IObuff, ptr, len);
|
||||
ptr = ml_get_buf(ins_buf, pos->lnum + 1, FALSE);
|
||||
ptr = ml_get_buf(ins_buf, pos->lnum + 1, false);
|
||||
tmp_ptr = ptr = skipwhite(ptr);
|
||||
/* Find start of next word. */
|
||||
tmp_ptr = find_word_start(tmp_ptr);
|
||||
|
||||
Reference in New Issue
Block a user