]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2120: un-used assignment in do_source_buffer_init v9.0.2120
authorChristian Brabandt <cb@256bit.org>
Sun, 19 Nov 2023 18:06:16 +0000 (19:06 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 21 Nov 2023 18:59:54 +0000 (19:59 +0100)
Problem:  un-used assignment in do_source_buffer_init
Solution: Remove it

Coverity warns about assigning NULL to line in scriptfile.c:1408,
because right after that assignment, in the next iteration of the loop,
line will be overwritten by the next value from vim_strsave().

And in case this was the last iteration, the line variable is no longer
used until the function returns. So we can safely remove that assignment.

closes: #13547

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/scriptfile.c
src/version.c

index e9c124e9fedfde842c5561154e36fa0c73fa5c8e..35582a84c92444b15d518031419b91320d9ba06b 100644 (file)
@@ -1405,7 +1405,6 @@ do_source_buffer_init(source_cookie_T *sp, exarg_T *eap)
            goto errret;
        if (ga_add_string(&sp->buflines, line) == FAIL)
            goto errret;
-       line = NULL;
     }
     sp->buf_lnum = 0;
     sp->source_from_buf = TRUE;
index 9379c26e6dced394869f945d2c59da4654a71db7..edf6b576fe2a2abee0d1fa0c94cdf2303c37aa41 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2120,
 /**/
     2119,
 /**/