mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.0501: cppcheck warns for using array index before bounds check
Problem: Cppcheck warns for using array index before bounds check. Solution: Swap the conditions. (Dominique Pelle)
This commit is contained in:
@@ -5029,8 +5029,8 @@ ml_updatechunk(
|
|||||||
curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
|
curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines
|
else if (curix < buf->b_ml.ml_usedchunks - 1
|
||||||
&& curix < buf->b_ml.ml_usedchunks - 1)
|
&& line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines)
|
||||||
{
|
{
|
||||||
/* Adjust cached curix & curline */
|
/* Adjust cached curix & curline */
|
||||||
curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
|
curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
|
||||||
|
@@ -792,6 +792,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 */
|
||||||
|
/**/
|
||||||
|
501,
|
||||||
/**/
|
/**/
|
||||||
500,
|
500,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user