From: Guy Harris Date: Sun, 14 Nov 2021 02:34:00 +0000 (-0800) Subject: EAP: no need for the count variable to be signed. X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/6569fb794592b16cc7c596a74444be77429f617a?ds=sidebyside 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. --- diff --git a/print-eap.c b/print-eap.c index 1539b7a7..8a2411cb 100644 --- a/print-eap.c +++ b/print-eap.c @@ -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;