mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +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:
@@ -2257,7 +2257,7 @@ static void use_midword(slang_T *lp, win_T *wp)
|
||||
wp->w_s->b_spell_ismw[c] = true;
|
||||
} else if (wp->w_s->b_spell_ismw_mb == NULL) {
|
||||
// First multi-byte char in "b_spell_ismw_mb".
|
||||
wp->w_s->b_spell_ismw_mb = xstrnsave(p, (size_t)l);
|
||||
wp->w_s->b_spell_ismw_mb = xmemdupz(p, (size_t)l);
|
||||
} else {
|
||||
// Append multi-byte chars to "b_spell_ismw_mb".
|
||||
const int n = (int)strlen(wp->w_s->b_spell_ismw_mb);
|
||||
|
Reference in New Issue
Block a user