]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.0373: Coverity warns for NULL check and unused return value v9.0.0373
authorBram Moolenaar <Bram@vim.org>
Sun, 4 Sep 2022 10:42:22 +0000 (11:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 4 Sep 2022 10:42:22 +0000 (11:42 +0100)
Problem:    Coverity warns for NULL check and unused return value.
Solution:   Remove the NULL check, it was already checked earlier.  Add (void)
            to ignore the return value.

src/ex_eval.c
src/version.c
src/vim9execute.c

index 61d288157da8ec2d8e827aa73796205eff4c3bfa..2f31b3e1c572fe158a4b8adb91a663be57314424 100644 (file)
@@ -925,7 +925,7 @@ cmd_is_name_only(char_u *arg)
        }
        else if (*p == '$')
            ++p;
-       get_name_len(&p, &alias, FALSE, FALSE);
+       (void)get_name_len(&p, &alias, FALSE, FALSE);
     }
     name_only = ends_excmd2(arg, skipwhite(p));
     vim_free(alias);
index 0209280f03dd0cd636b896ae59fb4727f641d5f0..c7683020328c200aaa62dfbd0032f6ea710dc6ec 100644 (file)
@@ -707,6 +707,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    373,
 /**/
     372,
 /**/
index 3e0a37773880976b27e4a619721aca6fbfd62e63..3c4f1a2583b342b2a41c91de78318d598ee746bb 100644 (file)
@@ -862,7 +862,7 @@ add_defer_func(int var_idx, int argcount, ectx_T *ectx)
 
     if (defer_tv->v_type != VAR_LIST)
     {
-       // first one, allocate the list
+       // first time, allocate the list
        if (rettv_list_alloc(defer_tv) == FAIL)
            return FAIL;
     }
@@ -874,8 +874,7 @@ add_defer_func(int var_idx, int argcount, ectx_T *ectx)
     listval.v_type = VAR_LIST;
     listval.vval.v_list = l;
     listval.v_lock = 0;
-    if (list_insert_tv(defer_l, &listval,
-                          defer_l == NULL ? NULL : defer_l->lv_first) == FAIL)
+    if (list_insert_tv(defer_l, &listval, defer_l->lv_first) == FAIL)
     {
        vim_free(l);
        return FAIL;