mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +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:
@@ -2646,7 +2646,7 @@ void f_strcharpart(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
}
|
||||
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = xstrndup(p + nbyte, (size_t)len);
|
||||
rettv->vval.v_string = xmemdupz(p + nbyte, (size_t)len);
|
||||
}
|
||||
|
||||
/// "strpart()" function
|
||||
|
Reference in New Issue
Block a user