From 61c422a88caefe986c2bc0a7f2f3028f696fa5cd Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Sat, 2 Dec 2017 14:19:13 +0100 Subject: Use more the EXTRACT_U_1() macro (43/n) In: if (... p[n] ...) ... --- print-vjc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'print-vjc.c') diff --git a/print-vjc.c b/print-vjc.c index 597ba060..b5f88ab6 100644 --- a/print-vjc.c +++ b/print-vjc.c @@ -30,6 +30,7 @@ #include #include "netdissect.h" +#include "extract.h" #include "slcompress.h" #include "ppp.h" @@ -100,10 +101,10 @@ vjc_print(netdissect_options *ndo, register const u_char *bp, u_short proto _U_) if (ndo->ndo_eflag) ND_PRINT((ndo, "(vjc type=compressed TCP) ")); for (i = 0; i < 8; i++) { - if (bp[1] & (0x80 >> i)) + if (EXTRACT_U_1(bp + 1) & (0x80 >> i)) ND_PRINT((ndo, "%c", "?CI?SAWU"[i])); } - if (bp[1]) + if (EXTRACT_U_1(bp + 1)) ND_PRINT((ndo, " ")); ND_PRINT((ndo, "C=0x%02x ", bp[2])); ND_PRINT((ndo, "sum=0x%04x ", *(const u_short *)(bp + 3))); -- cgit v1.2.1