mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user