]> The Tcpdump Group git mirrors - tcpdump/commitdiff
ISIS: Replace the 'if (nd_printzp()) goto trunc' by nd_printjnp() calls
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 10 Dec 2020 20:23:46 +0000 (21:23 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 10 Dec 2020 20:43:48 +0000 (21:43 +0100)
Moreover:
Use the sizeof operator.

print-isoclns.c

index 6762f4d9f8ecb83ea4a797b6e43b7bcb5ecfe4ac..3b4a150211d133b895821bae51348a4889686447 100644 (file)
@@ -1465,8 +1465,7 @@ isis_print_mcid(netdissect_options *ndo,
   ND_TCHECK_SIZE(mcid);
   ND_PRINT("ID: %u, Name: ", GET_U_1(mcid->format_id));
 
-  if (nd_printzp(ndo, mcid->name, 32, ndo->ndo_snapend))
-      goto trunc;
+  nd_printjnp(ndo, mcid->name, sizeof(mcid->name));
 
   ND_PRINT("\n\t              Lvl: %u", GET_BE_U_2(mcid->revision_lvl));
 
@@ -3120,8 +3119,7 @@ isis_print(netdissect_options *ndo,
 
            switch (auth_type) {
            case ISIS_SUBTLV_AUTH_SIMPLE:
-               if (nd_printzp(ndo, tptr, tlen, ndo->ndo_snapend))
-                   goto trunc;
+               nd_printjnp(ndo, tptr, tlen);
                break;
            case ISIS_SUBTLV_AUTH_MD5:
                for(i=0;i<tlen;i++) {
@@ -3248,8 +3246,7 @@ isis_print(netdissect_options *ndo,
 
        case ISIS_TLV_HOSTNAME:
            ND_PRINT("\n\t      Hostname: ");
-           if (nd_printzp(ndo, tptr, tlen, ndo->ndo_snapend))
-               goto trunc;
+           nd_printjnp(ndo, tptr, tlen);
            break;
 
        case ISIS_TLV_SHARED_RISK_GROUP: