aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/file_search.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-10 08:39:21 +0800
committerGitHub <noreply@github.com>2023-11-10 08:39:21 +0800
commitcd63a9addd6e1114c3524fa041ece560550cfe7b (patch)
tree846797f471b5de4c230838620ceaeda860de9e17 /src/nvim/file_search.c
parentae8ca79920a8d0e928ac1502a10d1d063a06cae5 (diff)
downloadrneovim-cd63a9addd6e1114c3524fa041ece560550cfe7b.tar.gz
rneovim-cd63a9addd6e1114c3524fa041ece560550cfe7b.tar.bz2
rneovim-cd63a9addd6e1114c3524fa041ece560550cfe7b.zip
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.
Diffstat (limited to 'src/nvim/file_search.c')
-rw-r--r--src/nvim/file_search.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c
index 796769d7ff..5bdaaa880e 100644
--- a/src/nvim/file_search.c
+++ b/src/nvim/file_search.c
@@ -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++;