Make it unsigned, and, while we're at it, make the loop a for loop.
u_int length)
{
u_int type, subtype, len;
u_int length)
{
u_int type, subtype, len;
type = GET_U_1(cp);
len = GET_BE_U_2(cp + 2);
type = GET_U_1(cp);
len = GET_BE_U_2(cp + 2);
break;
case EAP_TYPE_NAK:
break;
case EAP_TYPE_NAK:
/*
* one or more octets indicating
* the desired authentication
* type one octet per type
*/
/*
* 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));
ND_PRINT(" %s (%u),",
tok2str(eap_type_values, "unknown", GET_U_1((cp + count))),
GET_U_1(cp + count));