mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +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:
@@ -1374,7 +1374,7 @@ static int expand_backtick(garray_T *gap, char *pat, int flags)
|
||||
int cnt = 0;
|
||||
|
||||
// Create the command: lop off the backticks.
|
||||
char *cmd = xstrnsave(pat + 1, strlen(pat) - 2);
|
||||
char *cmd = xmemdupz(pat + 1, strlen(pat) - 2);
|
||||
|
||||
if (*cmd == '=') { // `={expr}`: Expand expression
|
||||
buffer = eval_to_string(cmd + 1, true);
|
||||
|
Reference in New Issue
Block a user