EAP: no need for the count variable to be signed.

Make it unsigned, and, while we're at it, make the loop a for loop.
This commit is contained in:
Guy Harris 2021-11-13 18:34:00 -08:00
parent 47b4131380
commit 6569fb7945

View File

@ -152,7 +152,7 @@ eap_print(netdissect_options *ndo,
u_int length)
{
u_int type, subtype, len;
int count;
u_int count;
type = GET_U_1(cp);
len = GET_BE_U_2(cp + 2);
@ -190,18 +190,15 @@ eap_print(netdissect_options *ndo,
break;
case EAP_TYPE_NAK:
count = 5;
/*
* one or more octets indicating
* the desired authentication
* type one octet per type
*/
while (count < (int)len) {
for (count = 5; count < len; count++) {
ND_PRINT(" %s (%u),",
tok2str(eap_type_values, "unknown", GET_U_1((cp + count))),
GET_U_1(cp + count));
count++;
}
break;