mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
vim-patch:8.1.0501: cppcheck warns for using array index before bounds check (#9178)
Problem: Cppcheck warns for using array index before bounds check.
Solution: Swap the conditions. (Dominique Pelle)
a9a8e04eab
This commit is contained in:

committed by
Justin M. Keyes

parent
b24209dcf5
commit
f9fe903579
@@ -3709,9 +3709,9 @@ static void ml_updatechunk(buf_T *buf, linenr_T line, long len, int updtype)
|
|||||||
curix++) {
|
curix++) {
|
||||||
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;
|
||||||
curix++;
|
curix++;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user