]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the EXTRACT_U_1() macro (41/n)
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 1 Dec 2017 22:08:23 +0000 (23:08 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 1 Dec 2017 22:48:54 +0000 (23:48 +0100)
In: switch (... *(p) ...) ...

print-dccp.c
print-isoclns.c
print-mpls.c

index 3c6435bada4ef5c3772d5f19b5fb68b622654973..0e541793b8427dcc72e9dc4ed8531eca7554ea1d 100644 (file)
@@ -576,7 +576,7 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in
                }
        } else {
                ND_PRINT((ndo, "%s", tok2str(dccp_option_values, "Option %u", EXTRACT_U_1(option))));
-               switch (*option) {
+               switch (EXTRACT_U_1(option)) {
                case 32:
                case 33:
                case 34:
index e4bc69412abc34bacdb347cabec8fef0f54bff5b..f0e6ee584331685d8378359f0a70060ced87b33c 100644 (file)
@@ -680,7 +680,7 @@ isoclns_print(netdissect_options *ndo, const uint8_t *p, u_int length)
        if (ndo->ndo_eflag)
                ND_PRINT((ndo, "OSI NLPID %s (0x%02x): ", tok2str(nlpid_values, "Unknown", EXTRACT_U_1(p)), EXTRACT_U_1(p)));
 
-       switch (*p) {
+       switch (EXTRACT_U_1(p)) {
 
        case NLPID_CLNP:
                if (!clnp_print(ndo, p, length))
index 9d773214d3d7feb18384d94b3bb0c02aed762cc4..2b287e79d5ef5213de0be685316a33fe1449c2f9 100644 (file)
@@ -134,7 +134,7 @@ mpls_print(netdissect_options *ndo, const u_char *bp, u_int length)
                        /* nothing to print */
                        return;
                }
-               switch(*p) {
+               switch(EXTRACT_U_1(p)) {
 
                case 0x45:
                case 0x46: