]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-calm-fast.c
Use more the ND_TTEST_1() macro
[tcpdump] / print-calm-fast.c
index c9be008cc29fc497ac41db6e5959a538d230c967..6fa91a8feb2bbea136c5ffc4c12945f7fd16e6d1 100644 (file)
@@ -24,6 +24,7 @@
 #include <netdissect-stdinc.h>
 
 #include "netdissect.h"
+#include "extract.h"
 #include "addrtoname.h"
 
 /*
@@ -42,11 +43,11 @@ calm_fast_print(netdissect_options *ndo, const u_char *bp, u_int length, const s
        int srcNwref;
        int dstNwref;
 
-       ND_TCHECK2(*bp, 2);
+       ND_TCHECK_2(bp);
        if (length < 2)
                goto trunc;
-       srcNwref = bp[0];
-       dstNwref = bp[1];
+       srcNwref = EXTRACT_U_1(bp);
+       dstNwref = EXTRACT_U_1(bp + 1);
        length -= 2;
        bp += 2;