summaryrefslogtreecommitdiffstats
path: root/src/filepath.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-06-11 10:43:26 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-11 10:43:26 +0100
commita34b4460c2843c67a35a2d236b01e6cb9bc38734 (patch)
tree8e59b458c22bad964993b790511d05fc131e4b94 /src/filepath.c
parent2e7cba347fc8b746add12aa5e0e9f6218a76c788 (diff)
patch 8.2.5077: various warnings from clang on MS-Windowsv8.2.5077
Problem: Various warnings from clang on MS-Windows. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #10553)
Diffstat (limited to 'src/filepath.c')
-rw-r--r--src/filepath.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/filepath.c b/src/filepath.c
index 3f7825ceda..654d03aab0 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -191,7 +191,8 @@ shortpath_for_invalid_fname(
}
// concat the not-shortened part of the path
- vim_strncpy(*fname + len, endp, sfx_len);
+ if ((*fname + len) != endp)
+ vim_strncpy(*fname + len, endp, sfx_len);
(*fname)[new_len] = NUL;
}