Patch 8.1.0501
Problem:    Cppcheck warns for using array index before bounds check.
Solution:   Swap the conditions. (Dominique Pelle)
Files:      src/memline.c


*** ../vim-8.1.0500/src/memline.c       2018-10-13 19:06:23.502240830 +0200
--- src/memline.c       2018-10-30 22:09:37.994123602 +0100
***************
*** 5029,5036 ****
            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)
      {
        /* Adjust cached curix & curline */
        curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
--- 5029,5036 ----
            curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
        }
      }
!     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;
*** ../vim-8.1.0500/src/version.c       2018-10-28 15:43:54.248419267 +0100
--- src/version.c       2018-10-30 22:10:34.545673410 +0100
***************
*** 794,795 ****
--- 794,797 ----
  {   /* Add new patch number below this line */
+ /**/
+     501,
  /**/

-- 
Facepalm reply #9: "Speed up, you can drive 80 here" "Why, the cars behind us
are also driving 60"

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui