diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-21 18:12:03 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-21 18:25:06 +0100 |
commit | 8bb03d53090d8749f3cfa38531333042d665dd36 (patch) | |
tree | aa1c3e00b1f3803bdcca5737b93d957cd50175d3 | |
parent | 4b21d2bad77ab4744e6a693318311aae62195a21 (diff) | |
download | tcpdump-8bb03d53090d8749f3cfa38531333042d665dd36.tar.gz |
Use more the EXTRACT_8BITS() macro to fetch a one-byte value (15/n)
Assignment, one operator (step 2).
(*e1) op e2
-rw-r--r-- | print-atm.c | 2 | ||||
-rw-r--r-- | print-rrcp.c | 2 | ||||
-rw-r--r-- | smbutil.c | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/print-atm.c b/print-atm.c index c8a16ba6..bb7eaf3b 100644 --- a/print-atm.c +++ b/print-atm.c @@ -463,7 +463,7 @@ oam_print (netdissect_options *ndo, ND_TCHECK(*(p+ATM_HDR_LEN_NOHEC+hec)); cell_header = EXTRACT_BE_32BITS(p + hec); cell_type = ((*(p+ATM_HDR_LEN_NOHEC+hec))>>4) & 0x0f; - func_type = (*(p+ATM_HDR_LEN_NOHEC+hec)) & 0x0f; + func_type = EXTRACT_8BITS((p + ATM_HDR_LEN_NOHEC + hec)) & 0x0f; vpi = (cell_header>>20)&0xff; vci = (cell_header>>4)&0xffff; diff --git a/print-rrcp.c b/print-rrcp.c index 23c5412d..866e75b9 100644 --- a/print-rrcp.c +++ b/print-rrcp.c @@ -100,7 +100,7 @@ rrcp_print(netdissect_options *ndo, ND_TCHECK(*(cp + RRCP_PROTO_OFFSET)); rrcp_proto = *(cp + RRCP_PROTO_OFFSET); ND_TCHECK(*(cp + RRCP_OPCODE_ISREPLY_OFFSET)); - rrcp_opcode = (*(cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_OPCODE_MASK; + rrcp_opcode = EXTRACT_8BITS((cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_OPCODE_MASK; if (src != NULL && dst != NULL) { ND_PRINT((ndo, "%s > %s, ", (src->addr_string)(ndo, src->addr), @@ -133,7 +133,8 @@ name_interpret(netdissect_options *ndo, if (in >= maxbuf) return(-1); /* name goes past the end of the buffer */ ND_TCHECK2(*in, 1); - len = (*in++) / 2; + len = EXTRACT_8BITS(in) / 2; + in++; *out=0; |