0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 7.4.2028

Problem:    cppcheck warns for using index before limits check.
Solution:   Swap the expressions. (Dominique Pelle)
This commit is contained in:
Bram Moolenaar
2016-07-11 23:19:05 +02:00
parent 4c06815c44
commit 5498a41f5a
2 changed files with 3 additions and 1 deletions

View File

@@ -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] = '-';