1
0
forked from aniani/vim

patch 9.0.2120: un-used assignment in do_source_buffer_init

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>
This commit is contained in:
Christian Brabandt
2023-11-19 19:06:16 +01:00
parent 6b36645f07
commit 4e5c3cf07b
2 changed files with 2 additions and 1 deletions

View 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;