vim-patch:7.4.2028

Problem:    cppcheck warns for using index before limits check.
Solution:   Swap the expressions. (Dominique Pelle)

5498a41f5a
This commit is contained in:
rover 2017-01-01 21:30:32 +08:00
parent 6705652928
commit 13e2e22073
2 changed files with 6 additions and 5 deletions

View File

@ -2109,13 +2109,14 @@ char_u * enc_locale(void)
} else
s = p + 1;
}
for (i = 0; s[i] != NUL && i < (int)sizeof(buf) - 1; ++i) {
if (s[i] == '_' || s[i] == '-')
for (i = 0; i < (int)sizeof(buf) - 1 && s[i] != NUL; i++) {
if (s[i] == '_' || s[i] == '-') {
buf[i] = '-';
else if (isalnum((int)s[i]))
} else if (isalnum((int)s[i])) {
buf[i] = TOLOWER_ASC(s[i]);
else
} else {
break;
}
}
buf[i] = NUL;

View File

@ -412,7 +412,7 @@ static int included_patches[] = {
// 2031,
// 2030 NA
// 2029,
// 2028,
2028,
// 2027 NA
// 2026 NA
// 2025 NA