summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-23 20:47:12 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-23 20:47:12 +0100
commitfffbf308dd98d1129ba4914d921ab47dc6a6c9b1 (patch)
tree61d04ac4753014bbc29eb25ea420240d3cc565cd
parentc81299684b2b9045e56525d3da3f45e8440fbf0d (diff)
downloadvim-fffbf308dd98d1129ba4914d921ab47dc6a6c9b1.zip
patch 8.0.0223: Coverity warns for an uninitialized variable
Problem: Coverity gets confused by the flags passed to find_tags() and warnts for an uninitialized variable. Solution: Disallow using cscope and help tags at the same time.
-rw-r--r--src/tag.c12
-rw-r--r--src/version.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/tag.c b/src/tag.c
index bd0dd740c..83890698f 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -1256,6 +1256,7 @@ prepare_pats(pat_T *pats, int has_re)
* TAG_REGEXP use "pat" as a regexp
* TAG_NOIC don't always ignore case
* TAG_KEEP_LANG keep language
+ * TAG_CSCOPE use cscope results for tags
*/
int
find_tags(
@@ -1423,6 +1424,14 @@ find_tags(
*/
if (help_only) /* want tags from help file */
curbuf->b_help = TRUE; /* will be restored later */
+#ifdef FEAT_CSCOPE
+ else if (use_cscope)
+ {
+ /* Make sure we don't mix help and cscope, confuses Coverity. */
+ help_only = FALSE;
+ curbuf->b_help = FALSE;
+ }
+#endif
orgpat.len = (int)STRLEN(pat);
#ifdef FEAT_MULTI_LANG
@@ -2281,7 +2290,8 @@ parse_line:
*/
*tagp.tagname_end = NUL;
len = (int)(tagp.tagname_end - tagp.tagname);
- mfp = (char_u *)alloc((int)sizeof(char_u) + len + 10 + ML_EXTRA + 1);
+ mfp = (char_u *)alloc((int)sizeof(char_u)
+ + len + 10 + ML_EXTRA + 1);
if (mfp != NULL)
{
int heuristic;
diff --git a/src/version.c b/src/version.c
index cae4e7dd4..d92b6ed26 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 223,
+/**/
222,
/**/
221,