mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 13:26:06 +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:
@@ -274,7 +274,7 @@ list_T *heredoc_get(exarg_T *eap, char *cmd, bool script_get)
|
||||
p++;
|
||||
text_indent_len++;
|
||||
}
|
||||
text_indent = xstrnsave(theline, (size_t)text_indent_len);
|
||||
text_indent = xmemdupz(theline, (size_t)text_indent_len);
|
||||
}
|
||||
// with "trim": skip the indent matching the first line
|
||||
if (text_indent != NULL) {
|
||||
|
Reference in New Issue
Block a user