mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 15:28:17 +00:00
Remove '- 1' for sizes passed to xstrlcpy
xstrlcpy() NUL-terminates the destination string such that reducing the destination string length by 1 to reserve the last byte for NUL is pointless. https://github.com/neovim/neovim/pull/14490#discussion_r635661185
This commit is contained in:
@@ -65,7 +65,7 @@ FileComparison path_full_compare(char_u *const s1, char_u *const s2,
|
||||
if (expandenv) {
|
||||
expand_env(s1, exp1, MAXPATHL);
|
||||
} else {
|
||||
xstrlcpy((char *)exp1, (const char *)s1, MAXPATHL - 1);
|
||||
xstrlcpy((char *)exp1, (const char *)s1, MAXPATHL);
|
||||
}
|
||||
bool id_ok_1 = os_fileid((char *)exp1, &file_id_1);
|
||||
bool id_ok_2 = os_fileid((char *)s2, &file_id_2);
|
||||
|
Reference in New Issue
Block a user