]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the ND_TCHECK_1() macro
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 4 Dec 2017 19:21:48 +0000 (20:21 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 4 Dec 2017 20:00:57 +0000 (21:00 +0100)
24 files changed:
print-aodv.c
print-atm.c
print-bgp.c
print-dccp.c
print-domain.c
print-forces.c
print-ip.c
print-ip6.c
print-isoclns.c
print-krb.c
print-mpls.c
print-msdp.c
print-ospf.c
print-otv.c
print-resp.c
print-rrcp.c
print-slow.c
print-smb.c
print-snmp.c
print-tcp.c
print-telnet.c
print-tftp.c
smbutil.c
util-print.c

index 61a9f0b95e1c257a457e892a3eb5178eccdbc149..4d1b26892c6e167cb7940ec44d2e8179f485c2e2 100644 (file)
@@ -482,7 +482,7 @@ aodv_print(netdissect_options *ndo,
         * The message type is the first byte; make sure we have it
         * and then fetch it.
         */
-       ND_TCHECK(*dat);
+       ND_TCHECK_1(dat);
        msg_type = *dat;
        ND_PRINT((ndo, " aodv"));
 
index 616bc4f892cba46c0494e0994ae8f2c761540c1e..27106b4645983e37f91e58776b696732bef54cad 100644 (file)
@@ -460,7 +460,7 @@ oam_print (netdissect_options *ndo,
     } oam_ptr;
 
 
-    ND_TCHECK(*(p+ATM_HDR_LEN_NOHEC+hec));
+    ND_TCHECK_1(p + ATM_HDR_LEN_NOHEC + hec);
     cell_header = EXTRACT_BE_U_4(p + hec);
     cell_type = (EXTRACT_U_1((p + ATM_HDR_LEN_NOHEC + hec)) >> 4) & 0x0f;
     func_type = EXTRACT_U_1((p + ATM_HDR_LEN_NOHEC + hec)) & 0x0f;
index 9704081c478e25901fce334362a33cb8a0e198e9..83e0194ccad0d3d01e1c03fe712964310fdd8345 100644 (file)
@@ -1398,7 +1398,7 @@ bgp_attr_print(netdissect_options *ndo,
                if (len != 1)
                        ND_PRINT((ndo, "invalid len"));
                else {
-                       ND_TCHECK(*tptr);
+                       ND_TCHECK_1(tptr);
                        ND_PRINT((ndo, "%s", tok2str(bgp_origin_values,
                                                "Unknown Origin Typecode",
                                                EXTRACT_U_1(tptr))));
index 0e541793b8427dcc72e9dc4ed8531eca7554ea1d..59edea5a2bd6f243bc017cc3e5f47b164a1122a3 100644 (file)
@@ -535,10 +535,10 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in
 {
        uint8_t optlen, i;
 
-       ND_TCHECK(*option);
+       ND_TCHECK_1(option);
 
        if (*option >= 32) {
-               ND_TCHECK(*(option+1));
+               ND_TCHECK_1(option + 1);
                optlen = EXTRACT_U_1(option + 1);
                if (optlen < 2) {
                        if (*option >= 128)
index e150116d84eb8583e346fe08a1757c5dd6e490bf..c0c05d6737a447ec431b3ccb9154ac62407b6dfb 100644 (file)
@@ -104,16 +104,16 @@ blabel_print(netdissect_options *ndo,
        /* print the bit string as a hex string */
        ND_PRINT((ndo, "\\[x"));
        for (bitp = cp + 1, b = bitlen; bitp < lim && b > 7; b -= 8, bitp++) {
-               ND_TCHECK(*bitp);
+               ND_TCHECK_1(bitp);
                ND_PRINT((ndo, "%02x", EXTRACT_U_1(bitp)));
        }
        if (b > 4) {
-               ND_TCHECK(*bitp);
+               ND_TCHECK_1(bitp);
                tc = EXTRACT_U_1(bitp);
                bitp++;
                ND_PRINT((ndo, "%02x", tc & (0xff << (8 - b))));
        } else if (b > 0) {
-               ND_TCHECK(*bitp);
+               ND_TCHECK_1(bitp);
                tc = EXTRACT_U_1(bitp);
                bitp++;
                ND_PRINT((ndo, "%1x", ((tc >> 4) & 0x0f) & (0x0f << (4 - b))));
index f3ca76a310cf649487b7ebee043411a88500a788..affb723cbba4a77fba9b15ff0b3c515fdd93aa7a 100644 (file)
@@ -801,7 +801,7 @@ pkeyitlv_print(netdissect_options *ndo,
        uint16_t type, tll;
        u_int invtlv;
 
-       ND_TCHECK(*tdp);
+       ND_TCHECK_1(tdp);
        id = EXTRACT_BE_U_4(tdp);
        ND_PRINT((ndo, "%sKeyinfo: Key 0x%x\n", ib, id));
        ND_TCHECK(*kdtlv);
index 9be07f2029fe0f702d7f347d03cd6494d87005c0..64599835f96a8f38068c3285c793992678a6efc7 100644 (file)
@@ -106,7 +106,7 @@ ip_finddst(netdissect_options *ndo,
        for (; length > 0; cp += len, length -= len) {
                int tt;
 
-               ND_TCHECK(*cp);
+               ND_TCHECK_1(cp);
                tt = *cp;
                if (tt == IPOPT_EOL)
                        break;
@@ -254,7 +254,7 @@ ip_optprint(netdissect_options *ndo,
                ND_PRINT((ndo, "%s", sep));
                sep = ",";
 
-               ND_TCHECK(*cp);
+               ND_TCHECK_1(cp);
                option_code = *cp;
 
                ND_PRINT((ndo, "%s",
@@ -706,7 +706,7 @@ ipN_print(netdissect_options *ndo, register const u_char *bp, register u_int len
                return;
        }
 
-       ND_TCHECK(*bp);
+       ND_TCHECK_1(bp);
        switch (*bp & 0xF0) {
        case 0x40:
                ip_print (ndo, bp, length);
index 237c36d49ce6d4471d6107b3d762b5199d3eae7e..5f6c647f043d88651122971414b4f6f6dbce6326 100644 (file)
@@ -329,7 +329,7 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length)
                        nh = EXTRACT_U_1(cp);
                        return;
                case IPPROTO_ROUTING:
-                       ND_TCHECK(*cp);
+                       ND_TCHECK_1(cp);
                        advance = rt6_print(ndo, cp, (const u_char *)ip6);
                        if (advance < 0)
                                return;
index f0e6ee584331685d8378359f0a70060ced87b33c..53ad5697ba50aab4baa0051eb8c484bf44a6e34f 100644 (file)
@@ -816,7 +816,7 @@ clnp_print(netdissect_options *ndo,
             ND_PRINT((ndo, "li < size of fixed part of CLNP header and addresses"));
             return (0);
         }
-       ND_TCHECK(*pptr);
+       ND_TCHECK_1(pptr);
         dest_address_length = EXTRACT_U_1(pptr);
         pptr += 1;
         li -= 1;
@@ -833,7 +833,7 @@ clnp_print(netdissect_options *ndo,
             ND_PRINT((ndo, "li < size of fixed part of CLNP header and addresses"));
             return (0);
         }
-       ND_TCHECK(*pptr);
+       ND_TCHECK_1(pptr);
         source_address_length = EXTRACT_U_1(pptr);
         pptr += 1;
         li -= 1;
@@ -1040,7 +1040,7 @@ clnp_print(netdissect_options *ndo,
 
         case    CLNP_PDU_ER: /* fall through */
         case   CLNP_PDU_ERP:
-            ND_TCHECK(*pptr);
+            ND_TCHECK_1(pptr);
             if (EXTRACT_U_1(pptr) == NLPID_CLNP) {
                 ND_PRINT((ndo, "\n\t-----original packet-----\n\t"));
                 /* FIXME recursion protection */
@@ -1174,7 +1174,7 @@ esis_print(netdissect_options *ndo,
                const uint8_t *dst, *snpa, *neta;
                u_int dstl, snpal, netal;
 
-               ND_TCHECK(*pptr);
+               ND_TCHECK_1(pptr);
                if (li < 1) {
                        ND_PRINT((ndo, ", bad redirect/li"));
                        return;
@@ -1192,7 +1192,7 @@ esis_print(netdissect_options *ndo,
                 li -= dstl;
                ND_PRINT((ndo, "\n\t  %s", isonsap_string(ndo, dst, dstl)));
 
-               ND_TCHECK(*pptr);
+               ND_TCHECK_1(pptr);
                if (li < 1) {
                        ND_PRINT((ndo, ", bad redirect/li"));
                        return;
@@ -1208,7 +1208,7 @@ esis_print(netdissect_options *ndo,
                snpa = pptr;
                pptr += snpal;
                 li -= snpal;
-               ND_TCHECK(*pptr);
+               ND_TCHECK_1(pptr);
                if (li < 1) {
                        ND_PRINT((ndo, ", bad redirect/li"));
                        return;
@@ -1240,7 +1240,7 @@ esis_print(netdissect_options *ndo,
        }
 
        case ESIS_PDU_ESH:
-            ND_TCHECK(*pptr);
+            ND_TCHECK_1(pptr);
             if (li < 1) {
                 ND_PRINT((ndo, ", bad esh/li"));
                 return;
@@ -1252,7 +1252,7 @@ esis_print(netdissect_options *ndo,
             ND_PRINT((ndo, "\n\t  Number of Source Addresses: %u", source_address_number));
 
             while (source_address_number > 0) {
-                ND_TCHECK(*pptr);
+                ND_TCHECK_1(pptr);
                if (li < 1) {
                     ND_PRINT((ndo, ", bad esh/li"));
                    return;
@@ -1277,7 +1277,7 @@ esis_print(netdissect_options *ndo,
             break;
 
        case ESIS_PDU_ISH: {
-            ND_TCHECK(*pptr);
+            ND_TCHECK_1(pptr);
             if (li < 1) {
                 ND_PRINT((ndo, ", bad ish/li"));
                 return;
index 6fa25acaffc02b321aff7851801449fab60055ff..24839bd4d9e64e7fcf5b6ea8fc805c33d850e461 100644 (file)
@@ -193,7 +193,7 @@ krb4_print(netdissect_options *ndo,
                if ((cp = krb4_print_hdr(ndo, cp)) == NULL)
                        return;
                cp += 4;        /* ctime */
-               ND_TCHECK(*cp);
+               ND_TCHECK_1(cp);
                ND_PRINT((ndo, " %dmin ", EXTRACT_U_1(cp) * 5));
                cp++;
                PRINT;
@@ -203,14 +203,14 @@ krb4_print(netdissect_options *ndo,
 
        case AUTH_MSG_APPL_REQUEST:
                cp += 2;
-               ND_TCHECK(*cp);
+               ND_TCHECK_1(cp);
                ND_PRINT((ndo, "v%d ", EXTRACT_U_1(cp)));
                cp++;
                PRINT;
-               ND_TCHECK(*cp);
+               ND_TCHECK_1(cp);
                ND_PRINT((ndo, " (%d)", EXTRACT_U_1(cp)));
                cp++;
-               ND_TCHECK(*cp);
+               ND_TCHECK_1(cp);
                ND_PRINT((ndo, " (%d)", EXTRACT_U_1(cp)));
                break;
 
index 2b287e79d5ef5213de0be685316a33fe1449c2f9..b156ef7fc5d6ffe2185bb04b0f4ffaf7b5f2a9fa 100644 (file)
@@ -129,7 +129,7 @@ mpls_print(netdissect_options *ndo, const u_char *bp, u_int length)
                 * Cisco sends control-plane traffic MPLS-encapsulated in
                 * this fashion.
                 */
-               ND_TCHECK(*p);
+               ND_TCHECK_1(p);
                if (length < 1) {
                        /* nothing to print */
                        return;
index 59a0a092ff8ddf95ada47ad3525ce03e30d0548b..e2ffde1b23f2f54ec872196f0613eb51f27ee0ff 100644 (file)
@@ -59,7 +59,7 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length)
                                ND_PRINT((ndo, " SA"));
                        else
                                ND_PRINT((ndo, " SA-Response"));
-                       ND_TCHECK(*sp);
+                       ND_TCHECK_1(sp);
                        ND_PRINT((ndo, " %u entries", EXTRACT_U_1(sp)));
                        if ((u_int)((*sp * 12) + 8) < len) {
                                ND_PRINT((ndo, " [w/data]"));
index 37e829e3df91c1e9c232180716780455f17ba359..ea6abaab151331fd288e809b480bf139dc452d3a 100644 (file)
@@ -931,7 +931,7 @@ ospf_decode_lls(netdissect_options *ndo,
     ND_PRINT((ndo, ", length: %u", length2));
 
     dptr += 2;
-    ND_TCHECK(*dptr);
+    ND_TCHECK_1(dptr);
     while (dptr < dataend) {
         ND_TCHECK_2(dptr);
         lls_type = EXTRACT_BE_U_2(dptr);
index f4daacfa63086a45a8ef0065a0c83cb88224afae..d7b062bce398f91dead68defc88a6030af832410 100644 (file)
@@ -49,7 +49,7 @@ otv_print(netdissect_options *ndo, const u_char *bp, u_int len)
     if (len < OTV_HDR_LEN)
         goto trunc;
 
-    ND_TCHECK(*bp);
+    ND_TCHECK_1(bp);
     flags = *bp;
     ND_PRINT((ndo, "flags [%s] (0x%02x), ", flags & 0x08 ? "I" : ".", flags));
     bp += 1;
@@ -63,7 +63,7 @@ otv_print(netdissect_options *ndo, const u_char *bp, u_int len)
     bp += 3;
 
     /* Reserved */
-    ND_TCHECK(*bp);
+    ND_TCHECK_1(bp);
     bp += 1;
 
     ether_print(ndo, bp, len - OTV_HDR_LEN, ndo->ndo_snapend - bp, NULL, NULL);
index d946c64945cc68f818d63ae0000a981c4cb31842..c2b6e63a7409bd0b3052c6bd73f1578506060519 100644 (file)
@@ -247,7 +247,7 @@ resp_parse(netdissect_options *ndo, register const u_char *bp, int length)
     int ret_len;
 
     LCHECK2(length, 1);
-    ND_TCHECK(*bp);
+    ND_TCHECK_1(bp);
     op = *bp;
 
     /* bp now points to the op, so these routines must skip it */
@@ -464,7 +464,7 @@ resp_get_length(netdissect_options *ndo, register const u_char *bp, int len, con
 
     if (len == 0)
         goto trunc;
-    ND_TCHECK(*bp);
+    ND_TCHECK_1(bp);
     too_large = 0;
     neg = 0;
     if (*bp == '-') {
@@ -478,7 +478,7 @@ resp_get_length(netdissect_options *ndo, register const u_char *bp, int len, con
     for (;;) {
         if (len == 0)
             goto trunc;
-        ND_TCHECK(*bp);
+        ND_TCHECK_1(bp);
         c = *bp;
         if (!(c >= '0' && c <= '9')) {
             if (!saw_digit) {
@@ -516,7 +516,7 @@ resp_get_length(netdissect_options *ndo, register const u_char *bp, int len, con
     len--;
     if (len == 0)
         goto trunc;
-    ND_TCHECK(*bp);
+    ND_TCHECK_1(bp);
     if (*bp != '\n') {
         bp++;
         goto invalid;
index ddacf94c80c180ee03c793e66d36291a49f299ad..d96b1dc42a6d255d87c4b07502dd7b630b475cae 100644 (file)
@@ -97,9 +97,9 @@ rrcp_print(netdissect_options *ndo,
        uint8_t rrcp_proto;
        uint8_t rrcp_opcode;
 
-       ND_TCHECK(*(cp + RRCP_PROTO_OFFSET));
+       ND_TCHECK_1(cp + RRCP_PROTO_OFFSET);
        rrcp_proto = EXTRACT_U_1(cp + RRCP_PROTO_OFFSET);
-       ND_TCHECK(*(cp + RRCP_OPCODE_ISREPLY_OFFSET));
+       ND_TCHECK_1(cp + RRCP_OPCODE_ISREPLY_OFFSET);
        rrcp_opcode = EXTRACT_U_1((cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_OPCODE_MASK;
        if (src != NULL && dst != NULL) {
                ND_PRINT((ndo, "%s > %s, ",
index 6f489ae251cae4f7d0b6eee3ba21cfaae6066ed2..dba842996959dcaffc627841e249a967b707b289 100644 (file)
@@ -250,7 +250,7 @@ slow_print(netdissect_options *ndo,
 
     if (len < 1)
         goto tooshort;
-    ND_TCHECK(*pptr);
+    ND_TCHECK_1(pptr);
     subtype = *pptr;
 
     /*
@@ -260,7 +260,7 @@ slow_print(netdissect_options *ndo,
     case SLOW_PROTO_LACP:
         if (len < 2)
             goto tooshort;
-        ND_TCHECK(*(pptr+1));
+        ND_TCHECK_1(pptr + 1);
         if (*(pptr+1) != LACP_VERSION) {
             ND_PRINT((ndo, "LACP version %u packet not supported", EXTRACT_U_1(pptr + 1)));
             return;
@@ -271,7 +271,7 @@ slow_print(netdissect_options *ndo,
     case SLOW_PROTO_MARKER:
         if (len < 2)
             goto tooshort;
-        ND_TCHECK(*(pptr+1));
+        ND_TCHECK_1(pptr + 1);
         if (*(pptr+1) != MARKER_VERSION) {
             ND_PRINT((ndo, "MARKER version %u packet not supported", EXTRACT_U_1(pptr + 1)));
             return;
index a4d0c931cf7da4953f01d212af4ab9e2897b0d41..b306cd1d267d0fc497d2ea26c41ec1fe1e5b1adc 100644 (file)
@@ -1188,7 +1188,7 @@ nbt_udp137_print(netdissect_options *ndo,
                if (restype == 0x21) {
                    int numnames;
 
-                   ND_TCHECK(*p);
+                   ND_TCHECK_1(p);
                    numnames = p[0];
                    p = smb_fdata(ndo, p, "NumNames=[B]\n", p + 1, 0);
                    if (p == NULL)
@@ -1197,7 +1197,7 @@ nbt_udp137_print(netdissect_options *ndo,
                        p = smb_fdata(ndo, p, "Name=[n2]\t#", maxbuf, 0);
                        if (p == NULL)
                            goto out;
-                       ND_TCHECK(*p);
+                       ND_TCHECK_1(p);
                        if (EXTRACT_U_1(p) & 0x80)
                            ND_PRINT((ndo, "<GROUP> "));
                        switch (EXTRACT_U_1(p) & 0x60) {
index fdb3499dc65e6ffb33060123eff82a63fb9f0de0..0c90132b5d2d74e5fd9326987ea86af4336e449e 100644 (file)
@@ -429,7 +429,7 @@ asn1_parse(netdissect_options *ndo,
                ND_PRINT((ndo, "[nothing to parse]"));
                return -1;
        }
-       ND_TCHECK(*p);
+       ND_TCHECK_1(p);
 
        /*
         * it would be nice to use a bit field, but you can't depend on them.
@@ -464,7 +464,7 @@ asn1_parse(netdissect_options *ndo,
                 * that won't fit in 32 bits.
                 */
                id = 0;
-               ND_TCHECK(*p);
+               ND_TCHECK_1(p);
                while (EXTRACT_U_1(p) & ASN_BIT8) {
                        if (len < 1) {
                                ND_PRINT((ndo, "[Xtagfield?]"));
@@ -474,13 +474,13 @@ asn1_parse(netdissect_options *ndo,
                        len--;
                        hdr++;
                        p++;
-                       ND_TCHECK(*p);
+                       ND_TCHECK_1(p);
                }
                if (len < 1) {
                        ND_PRINT((ndo, "[Xtagfield?]"));
                        return -1;
                }
-               ND_TCHECK(*p);
+               ND_TCHECK_1(p);
                elem->id = id = (id << 7) | EXTRACT_U_1(p);
                --len;
                ++hdr;
@@ -490,7 +490,7 @@ asn1_parse(netdissect_options *ndo,
                ND_PRINT((ndo, "[no asnlen]"));
                return -1;
        }
-       ND_TCHECK(*p);
+       ND_TCHECK_1(p);
        elem->asnlen = *p;
        p++; len--; hdr++;
        if (elem->asnlen & ASN_BIT8) {
@@ -770,7 +770,7 @@ asn1_print(netdissect_options *ndo,
                }
 
                for (; i-- > 0; p++) {
-                       ND_TCHECK(*p);
+                       ND_TCHECK_1(p);
                        o = (o << ASN_SHIFT7) + (*p & ~ASN_BIT8);
                        if (*p & ASN_LONGLEN)
                                continue;
@@ -922,7 +922,7 @@ smi_decode_oid(netdissect_options *ndo,
        unsigned int firstval;
 
        for (*oidlen = 0; i-- > 0; p++) {
-               ND_TCHECK(*p);
+               ND_TCHECK_1(p);
                o = (o << ASN_SHIFT7) + (*p & ~ASN_BIT8);
                if (*p & ASN_LONGLEN)
                    continue;
index 716642360001c24dbfcbcb655ff41ae43c807fd3..817c581c8e59cc95a8ff4bd7fad700a260f8bfa8 100644 (file)
@@ -428,13 +428,13 @@ tcp_print(netdissect_options *ndo,
                 while (hlen > 0) {
                         if (ch != '\0')
                                 ND_PRINT((ndo, "%c", ch));
-                        ND_TCHECK(*cp);
+                        ND_TCHECK_1(cp);
                         opt = EXTRACT_U_1(cp);
                         cp++;
                         if (ZEROLENOPT(opt))
                                 len = 1;
                         else {
-                                ND_TCHECK(*cp);
+                                ND_TCHECK_1(cp);
                                 len = EXTRACT_U_1(cp);
                                 cp++;  /* total including type, len */
                                 if (len < 2 || len > hlen)
index 8ff527b4849d1ca02b4fe7f00f48c8bc3815aa39..bbc4f231608fcb57a80b5bc550cea46d6882d02d 100644 (file)
@@ -443,7 +443,7 @@ telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print)
                                break;
                        p++;
                }
-               ND_TCHECK(*p);
+               ND_TCHECK_1(p);
                if (*p != IAC)
                        goto pktend;
 
@@ -515,7 +515,7 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length)
 
        osp = sp;
 
-       ND_TCHECK(*sp);
+       ND_TCHECK_1(sp);
        while (length > 0 && EXTRACT_U_1(sp) == IAC) {
                /*
                 * Parse the Telnet command without printing it,
@@ -544,7 +544,7 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length)
 
                sp += l;
                length -= l;
-               ND_TCHECK(*sp);
+               ND_TCHECK_1(sp);
        }
        if (!first) {
                if (ndo->ndo_Xflag && 2 < ndo->ndo_vflag)
index 314dfb41eff0d7d86ef769dee41bda3c7f9ea832..c0b1338493c7533642380e7f6e4322253ede5bc4 100644 (file)
@@ -139,7 +139,7 @@ tftp_print(netdissect_options *ndo,
 
                /* Print options, if any */
                while (length != 0) {
-                       ND_TCHECK(*bp);
+                       ND_TCHECK_1(bp);
                        if (*bp != '\0')
                                ND_PRINT((ndo, " "));
                        ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend);
@@ -153,7 +153,7 @@ tftp_print(netdissect_options *ndo,
        case OACK:
                /* Print options */
                while (length != 0) {
-                       ND_TCHECK(*bp);
+                       ND_TCHECK_1(bp);
                        if (*bp != '\0')
                                ND_PRINT((ndo, " "));
                        ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend);
index 0ec882339c1eab5739517e6e93e1cc3cf843cede..3206ead1bd36b7e244e32eb6e888f6c75d2924c3 100644 (file)
--- a/smbutil.c
+++ b/smbutil.c
@@ -636,7 +636,7 @@ smb_fdata1(netdissect_options *ndo,
            const char *s;
            uint32_t len;
 
-           ND_TCHECK(*buf);
+           ND_TCHECK_1(buf);
            if (*buf != 4 && *buf != 2) {
                ND_PRINT((ndo, "Error! ASCIIZ buffer of type %u", EXTRACT_U_1(buf)));
                return maxbuf;  /* give up */
index 892e07a73c990b296190f59edaf6da067b3459a3..13191e9c160398c795d42530fded1feadc1dc8d1 100644 (file)
@@ -53,6 +53,7 @@
 #include <string.h>
 
 #include "netdissect.h"
+#include "extract.h"
 #include "ascii_strcasecmp.h"
 #include "timeval-operations.h"
 
@@ -759,7 +760,7 @@ print_txt_line(netdissect_options *ndo, const char *protoname,
 
        startidx = idx;
        while (idx < len) {
-               ND_TCHECK(*(pptr+idx));
+               ND_TCHECK_1(pptr + idx);
                if (*(pptr+idx) == '\n') {
                        /*
                         * LF without CR; end of line.
@@ -775,7 +776,7 @@ print_txt_line(netdissect_options *ndo, const char *protoname,
                                /* not in this packet */
                                return (0);
                        }
-                       ND_TCHECK(*(pptr+idx+1));
+                       ND_TCHECK_1(pptr + idx + 1);
                        if (*(pptr+idx+1) == '\n') {
                                /*
                                 * CR-LF; end of line.