aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2018-04-15 20:36:21 +0300
committerZyX <kp-pav@yandex.ru>2018-04-15 20:36:21 +0300
commit24ee2613174250f9d32492c435c42daef3a44b21 (patch)
tree968082b05758bfbfebd4543326e00d88c077d905
parentb8f69b6b9a1b5339ba580e58725b8866339c1ad7 (diff)
downloadrneovim-24ee2613174250f9d32492c435c42daef3a44b21.tar.gz
rneovim-24ee2613174250f9d32492c435c42daef3a44b21.tar.bz2
rneovim-24ee2613174250f9d32492c435c42daef3a44b21.zip
if_cscope: Fix PVS/V560: condition would result in earlier return
Previous block just checks for totmatches being zero and returns if it is. And totmatches is unsigned, so `totmatches > 0` may never be true.
-rw-r--r--src/nvim/if_cscope.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index b78b56562c..5d7bd26a2b 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -1001,8 +1001,8 @@ static int cs_find_common(char *opt, char *pat, int forceit, int verbose,
return FALSE;
}
- if (qfpos != NULL && *qfpos != '0' && totmatches > 0) {
- /* fill error list */
+ if (qfpos != NULL && *qfpos != '0') {
+ // Fill error list.
FILE *f;
char_u *tmp = vim_tempname();
qf_info_T *qi = NULL;