mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
6705652928
commit
13e2e22073
@ -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;
|
||||
|
||||
|
@ -412,7 +412,7 @@ static int included_patches[] = {
|
||||
// 2031,
|
||||
// 2030 NA
|
||||
// 2029,
|
||||
// 2028,
|
||||
2028,
|
||||
// 2027 NA
|
||||
// 2026 NA
|
||||
// 2025 NA
|
||||
|
Loading…
Reference in New Issue
Block a user