]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the ND_TTEST_1() macro
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 15 Dec 2017 18:39:00 +0000 (19:39 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 15 Dec 2017 18:39:00 +0000 (19:39 +0100)
print-fr.c
print-ip.c
print-isoclns.c
print-pim.c
print-ppp.c
util-print.c

index 0d34c03912739f7bbf83e36cae2156b90a500c96..f1ff0af73bd3d19b0a5090cb83292877d9cf07ae 100644 (file)
@@ -802,7 +802,7 @@ q933_print(netdissect_options *ndo,
 
        ND_PRINT((ndo, "%s", ndo->ndo_eflag ? "" : "Q.933"));
 
-       if (length == 0 || !ND_TTEST(*p)) {
+       if (length == 0 || !ND_TTEST_1(p)) {
                if (!ndo->ndo_eflag)
                        ND_PRINT((ndo, ", "));
                ND_PRINT((ndo, "length %u", length));
@@ -821,7 +821,7 @@ q933_print(netdissect_options *ndo,
         * Get the call reference value.
         */
        for (i = 0; i < call_ref_length; i++) {
-               if (length == 0 || !ND_TTEST(*p)) {
+               if (length == 0 || !ND_TTEST_1(p)) {
                        if (!ndo->ndo_eflag)
                                ND_PRINT((ndo, ", "));
                        ND_PRINT((ndo, "length %u", olen));
@@ -835,7 +835,7 @@ q933_print(netdissect_options *ndo,
        /*
         * Get the message type.
         */
-       if (length == 0 || !ND_TTEST(*p)) {
+       if (length == 0 || !ND_TTEST_1(p)) {
                if (!ndo->ndo_eflag)
                        ND_PRINT((ndo, ", "));
                ND_PRINT((ndo, "length %u", olen));
@@ -851,7 +851,7 @@ q933_print(netdissect_options *ndo,
        non_locking_shift = 0;
        unshift_codeset = codeset;
        if (length != 0) {
-               if (!ND_TTEST(*p)) {
+               if (!ND_TTEST_1(p)) {
                        if (!ndo->ndo_eflag)
                                ND_PRINT((ndo, ", "));
                        ND_PRINT((ndo, "length %u", olen));
@@ -952,7 +952,7 @@ q933_print(netdissect_options *ndo,
                /*
                 * Get the first octet of the IE.
                 */
-               if (!ND_TTEST(*p)) {
+               if (!ND_TTEST_1(p)) {
                        if (!ndo->ndo_vflag) {
                                ND_PRINT((ndo, ", length %u", olen));
                        }
@@ -995,7 +995,7 @@ q933_print(netdissect_options *ndo,
                        /*
                         * No.  Get the IE length.
                         */
-                       if (length == 0 || !ND_TTEST(*p)) {
+                       if (length == 0 || !ND_TTEST_1(p)) {
                                if (!ndo->ndo_vflag) {
                                        ND_PRINT((ndo, ", length %u", olen));
                                }
index d24f46cc741c917a2f3d7f7c824cccd53c7a2bfa..1e9f1ed9e6fcd348bbc25ea5cf30877283f2ac73 100644 (file)
@@ -346,7 +346,7 @@ again:
        switch (ipds->nh) {
 
        case IPPROTO_AH:
-               if (!ND_TTEST(*ipds->cp)) {
+               if (!ND_TTEST_1(ipds->cp)) {
                        ND_PRINT((ndo, "[|AH]"));
                        break;
                }
index a1b4d07d162b752fbaeff8e19b1e5c107908735b..3d09f994eb564184b275af7d40feafd19e96c891 100644 (file)
@@ -671,7 +671,7 @@ struct isis_tlv_lsp {
 void
 isoclns_print(netdissect_options *ndo, const uint8_t *p, u_int length)
 {
-       if (!ND_TTEST(*p)) { /* enough bytes on the wire ? */
+       if (!ND_TTEST_1(p)) { /* enough bytes on the wire ? */
                ND_PRINT((ndo, "|OSI"));
                return;
        }
index 8e52de5a2843b7ebf37660df904a0ba18d05b4bd..fa6a345a8d7b3325a8bd8612fcc4a3ebd102148c 100644 (file)
@@ -259,7 +259,7 @@ pimv1_print(netdissect_options *ndo,
        ND_PRINT((ndo, " %s", tok2str(pimv1_type_str, "[type %u]", type)));
        switch (type) {
        case PIMV1_TYPE_QUERY:
-               if (ND_TTEST(bp[8])) {
+               if (ND_TTEST_1(bp + 8)) {
                        switch (EXTRACT_U_1(bp + 8) >> 4) {
                        case 0:
                                ND_PRINT((ndo, " Dense-mode"));
index 3b935ed59d4373d0a3fb3e1549fe5ce756099eea..31b87a24ebc079d8e90e9bd589e3fcf065930a62 100644 (file)
@@ -1410,7 +1410,7 @@ ppp_hdlc(netdissect_options *ndo,
         * Do this so that we dont overwrite the original packet
         * contents.
         */
-       for (s = p, t = b, i = length; i != 0 && ND_TTEST(*s); i--) {
+       for (s = p, t = b, i = length; i != 0 && ND_TTEST_1(s); i--) {
                c = EXTRACT_U_1(s);
                s++;
                if (c == 0x7d) {
index 4ac4bc49269a11e4bb15d68bd735f6ecabd0db33..58efc4b4b5a6dcc2c579701601284e69a0bf5198 100644 (file)
@@ -691,7 +691,7 @@ fetch_token(netdissect_options *ndo, const u_char *pptr, u_int idx, u_int len,
        size_t toklen = 0;
 
        for (; idx < len; idx++) {
-               if (!ND_TTEST(*(pptr + idx))) {
+               if (!ND_TTEST_1(pptr + idx)) {
                        /* ran past end of captured data */
                        return (0);
                }
@@ -725,7 +725,7 @@ fetch_token(netdissect_options *ndo, const u_char *pptr, u_int idx, u_int len,
         * an end-of-line (CR or LF).
         */
        for (; idx < len; idx++) {
-               if (!ND_TTEST(*(pptr + idx))) {
+               if (!ND_TTEST_1(pptr + idx)) {
                        /* ran past end of captured data */
                        break;
                }