iphlpapi: Fix a one counter for two loops error (PVS-Studio).

This commit is contained in:
Bruno Jesus 2014-10-24 01:47:02 -02:00 committed by Alexandre Julliard
parent c5aacafeea
commit 794d52273e
1 changed files with 3 additions and 2 deletions

View File

@ -983,6 +983,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
struct WS_sockaddr_in6 *sa;
const IN6_ADDR *addr, *mask;
BOOL done = FALSE;
ULONG k;
prefix->u.s.Length = sizeof(*prefix);
prefix->u.s.Flags = 0;
@ -1000,11 +1001,11 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
sa->sin6_scope_id = 0;
prefix->PrefixLength = 0;
for (i = 0; i < 8 && !done; i++)
for (k = 0; k < 8 && !done; k++)
{
for (j = 0; j < sizeof(WORD) * 8 && !done; j++)
{
if (mask->u.Word[i] & 1 << j) prefix->PrefixLength++;
if (mask->u.Word[k] & 1 << j) prefix->PrefixLength++;
else done = TRUE;
}
}