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;
|
||||
}
|
||||
}
|
||||
else if (line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines
|
||||
&& curix < buf->b_ml.ml_usedchunks - 1)
|
||||
else if (curix < buf->b_ml.ml_usedchunks - 1
|
||||
&& line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines)
|
||||
{
|
||||
/* Adjust cached curix & curline */
|
||||
curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
|
||||
|
Reference in New Issue
Block a user