forked from aniani/vim
patch 8.1.1974: Coverity warns for using pointer as array
Problem: Coverity warns for using pointer as array. Solution: Call var2fpos() directly instead of using f_line().
This commit is contained in:
@@ -1152,20 +1152,16 @@ non_zero_arg(typval_T *argvars)
|
|||||||
linenr_T
|
linenr_T
|
||||||
tv_get_lnum(typval_T *argvars)
|
tv_get_lnum(typval_T *argvars)
|
||||||
{
|
{
|
||||||
typval_T rettv;
|
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
int save_type;
|
|
||||||
|
|
||||||
lnum = (linenr_T)tv_get_number_chk(&argvars[0], NULL);
|
lnum = (linenr_T)tv_get_number_chk(&argvars[0], NULL);
|
||||||
if (lnum == 0) /* no valid number, try using line() */
|
if (lnum == 0) // no valid number, try using arg like line()
|
||||||
{
|
{
|
||||||
rettv.v_type = VAR_NUMBER;
|
int fnum;
|
||||||
save_type = argvars[1].v_type;
|
pos_T *fp = var2fpos(&argvars[0], TRUE, &fnum);
|
||||||
argvars[1].v_type = VAR_UNKNOWN;
|
|
||||||
f_line(argvars, &rettv);
|
if (fp != NULL)
|
||||||
lnum = (linenr_T)rettv.vval.v_number;
|
lnum = fp->lnum;
|
||||||
clear_tv(&rettv);
|
|
||||||
argvars[1].v_type = save_type;
|
|
||||||
}
|
}
|
||||||
return lnum;
|
return lnum;
|
||||||
}
|
}
|
||||||
|
@@ -761,6 +761,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1974,
|
||||||
/**/
|
/**/
|
||||||
1973,
|
1973,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user