changeset 9495:c086632cca2e v7.4.2028

commit https://github.com/vim/vim/commit/5498a41f5a62c3877fee0185adf3bf7245a9a547 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 11 23:19:05 2016 +0200 patch 7.4.2028 Problem: cppcheck warns for using index before limits check. Solution: Swap the expressions. (Dominique Pelle)
author Christian Brabandt <cb@256bit.org>
date Mon, 11 Jul 2016 23:30:07 +0200
parents 893b92179710
children ce54298c319f
files src/mbyte.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -4357,7 +4357,7 @@ enc_locale(void)
 	else
 	    s = p + 1;
     }
-    for (i = 0; s[i] != NUL && i < (int)sizeof(buf) - 1; ++i)
+    for (i = 0; i < (int)sizeof(buf) - 1 && s[i] != NUL; ++i)
     {
 	if (s[i] == '_' || s[i] == '-')
 	    buf[i] = '-';
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2028,
+/**/
     2027,
 /**/
     2026,