mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +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:
@@ -1993,7 +1993,7 @@ static char *next_fenc(char **pp, bool *alloced)
|
||||
r = enc_canonize(*pp);
|
||||
*pp += strlen(*pp);
|
||||
} else {
|
||||
r = xstrnsave(*pp, (size_t)(p - *pp));
|
||||
r = xmemdupz(*pp, (size_t)(p - *pp));
|
||||
*pp = p + 1;
|
||||
p = enc_canonize(r);
|
||||
xfree(r);
|
||||
|
Reference in New Issue
Block a user