mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
refactor: change some xstrndup() and xstrnsave() to xmemdupz() (#25959)
When the given length is exactly the number of bytes to copy, xmemdupz() makes the intention clearer.
This commit is contained in:
@@ -293,7 +293,7 @@ void *vim_findfile_init(char *path, char *filename, char *stopdirs, int level, i
|
||||
xstrlcpy(ff_expand_buffer, rel_fname, len + 1);
|
||||
search_ctx->ffsc_start_dir = FullName_save(ff_expand_buffer, false);
|
||||
} else {
|
||||
search_ctx->ffsc_start_dir = xstrnsave(rel_fname, len);
|
||||
search_ctx->ffsc_start_dir = xmemdupz(rel_fname, len);
|
||||
}
|
||||
if (*++path != NUL) {
|
||||
path++;
|
||||
|
Reference in New Issue
Block a user