mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
refactor: add xmemcpyz() and use it in place of some xstrlcpy() (#28422)
Problem: Using xstrlcpy() when the exact length of the string to be copied is known is not ideal because it requires adding 1 to the length and an unnecessary strlen(). Solution: Add xmemcpyz() and use it in place of such xstrlcpy() calls.
This commit is contained in:
@@ -1138,7 +1138,7 @@ static char *get_view_file(char c)
|
||||
}
|
||||
*s++ = '=';
|
||||
*s++ = c;
|
||||
xstrlcpy(s, ".vim", 5);
|
||||
xmemcpyz(s, S_LEN(".vim"));
|
||||
|
||||
xfree(sname);
|
||||
return retval;
|
||||
|
Reference in New Issue
Block a user