aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/help.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-28 13:33:38 +0800
committerGitHub <noreply@github.com>2024-01-28 13:33:38 +0800
commit74e695d22715e52f5561a185583b8c23d4fa0dd6 (patch)
treee69931a0ae798562d6faa3a949052b80fe3f02ca /src/nvim/help.c
parent2cd76a758b4511748d9482e5af58162a608516b4 (diff)
parent9d48266bed96d3ed9c7edf45e3b5fb8a9d0fda87 (diff)
downloadrneovim-74e695d22715e52f5561a185583b8c23d4fa0dd6.tar.gz
rneovim-74e695d22715e52f5561a185583b8c23d4fa0dd6.tar.bz2
rneovim-74e695d22715e52f5561a185583b8c23d4fa0dd6.zip
Merge pull request #27221 from BugLight/fix-coverity-found-bugs
Fix bugs found by coverity
Diffstat (limited to 'src/nvim/help.c')
-rw-r--r--src/nvim/help.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/help.c b/src/nvim/help.c
index c6a6108010..879e2801a7 100644
--- a/src/nvim/help.c
+++ b/src/nvim/help.c
@@ -701,6 +701,9 @@ void get_local_additions(void)
const char *const f1 = fnames[i1];
const char *const t1 = path_tail(f1);
const char *const e1 = strrchr(t1, '.');
+ if (e1 == NULL) {
+ continue;
+ }
if (path_fnamecmp(e1, ".txt") != 0
&& path_fnamecmp(e1, fname + 4) != 0) {
// Not .txt and not .abx, remove it.
@@ -715,7 +718,7 @@ void get_local_additions(void)
}
const char *const t2 = path_tail(f2);
const char *const e2 = strrchr(t2, '.');
- if (e1 == NULL || e2 == NULL) {
+ if (e2 == NULL) {
continue;
}
if (e1 - f1 != e2 - f2