]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Replace some ND_TTEST_*() with ND_TCHECK_*()
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 18 May 2018 10:53:48 +0000 (12:53 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 18 May 2018 11:16:16 +0000 (13:16 +0200)
print-krb.c
print-pgm.c

index d8c9165ad6ec0599284133fb90f1e6afcb48bc52..656c154efe1e485ade4097549e2875e098c68be0 100644 (file)
@@ -168,10 +168,7 @@ krb4_print(netdissect_options *ndo,
 
        kp = (const struct krb *)cp;
 
-       if (!ND_TTEST_1(kp->type)) {
-               nd_print_trunc(ndo);
-               return;
-       }
+       ND_TCHECK_1(kp->type);
 
        type = EXTRACT_U_1(kp->type) & (0xFF << 1);
 
index 79d6c6b2ab92482f684bc5dd421edfb266f646a4..83fab6be9d375b61b4b4f55bbf36f7ced18bda4b 100644 (file)
@@ -426,10 +426,7 @@ pgm_print(netdissect_options *ndo,
            /*
             * make sure there's enough for the first option header
             */
-           if (!ND_TTEST_LEN(bp, PGM_MIN_OPT_LEN)) {
-               nd_print_trunc(ndo);
-               return;
-           }
+           ND_TCHECK_LEN(bp, PGM_MIN_OPT_LEN);
 
            /*
             * That option header MUST be an OPT_LENGTH option
@@ -461,10 +458,7 @@ pgm_print(netdissect_options *ndo,
                    ND_PRINT("[Total option length leaves no room for final option]");
                    return;
                }
-               if (!ND_TTEST_2(bp)) {
-                   nd_print_trunc(ndo);
-                   return;
-               }
+               ND_TCHECK_2(bp);
                opt_type = EXTRACT_U_1(bp);
                bp++;
                opt_len = EXTRACT_U_1(bp);
@@ -478,10 +472,7 @@ pgm_print(netdissect_options *ndo,
                    ND_PRINT("[Total option length leaves no room for final option]");
                    return;
                }
-               if (!ND_TTEST_LEN(bp, opt_len - 2)) {
-                   nd_print_trunc(ndo);
-                   return;
-               }
+               ND_TCHECK_LEN(bp, opt_len - 2);
 
                switch (opt_type & PGM_OPT_MASK) {
                case PGM_OPT_LENGTH: