aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-19 21:06:49 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-19 21:09:53 -0400
commit49ab1b91e7cccb4fc5edad6d2fa8c547fb38942b (patch)
treed8df645e9f993a6903dda09fdf5d24c45680850b /src/nvim/path.c
parent003cda23123e98824ccc8f7467cf6800a8e75961 (diff)
downloadrneovim-49ab1b91e7cccb4fc5edad6d2fa8c547fb38942b.tar.gz
rneovim-49ab1b91e7cccb4fc5edad6d2fa8c547fb38942b.tar.bz2
rneovim-49ab1b91e7cccb4fc5edad6d2fa8c547fb38942b.zip
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
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 3e1713fbdd..fe50be5ea1 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -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);