aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spellsuggest.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/spellsuggest.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/spellsuggest.c')
-rw-r--r--src/nvim/spellsuggest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/spellsuggest.c b/src/nvim/spellsuggest.c
index 938e8cec8f..15ec652859 100644
--- a/src/nvim/spellsuggest.c
+++ b/src/nvim/spellsuggest.c
@@ -3146,7 +3146,7 @@ static void add_suggestion(suginfo_T *su, garray_T *gap, const char *goodword, i
if (i < 0) {
// Add a suggestion.
stp = GA_APPEND_VIA_PTR(suggest_T, gap);
- stp->st_word = xstrnsave(goodword, (size_t)goodlen);
+ stp->st_word = xmemdupz(goodword, (size_t)goodlen);
stp->st_wordlen = goodlen;
stp->st_score = score;
stp->st_altscore = altscore;