mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 06:46:07 +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:
@@ -1216,7 +1216,7 @@ void ex_match(exarg_T *eap)
|
||||
} else {
|
||||
p = skiptowhite(eap->arg);
|
||||
if (!eap->skip) {
|
||||
g = xstrnsave(eap->arg, (size_t)(p - eap->arg));
|
||||
g = xmemdupz(eap->arg, (size_t)(p - eap->arg));
|
||||
}
|
||||
p = skipwhite(p);
|
||||
if (*p == NUL) {
|
||||
|
Reference in New Issue
Block a user