]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ldp.c
Suppress bogus C4738 from MSVC.
[tcpdump] / print-ldp.c
index 50d146019257763b8bd8e85e960b8dbb50aaa796..bdf9a13843f88feae2c5b54dd95a027d4403b290 100644 (file)
@@ -16,9 +16,7 @@
 
 /* \summary: Label Distribution Protocol (LDP) printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -287,7 +285,7 @@ ldp_tlv_print(netdissect_options *ndo,
     const struct ldp_tlv_header *ldp_tlv_header;
     u_short tlv_type,tlv_len,tlv_tlen,af,ft_flags;
     u_char fec_type, transport_pref;
-    u_int ui,vc_info_len, vc_info_tlv_type, vc_info_tlv_len,idx;
+    u_int ui,vc_info_len, vc_info_tlv_type, vc_info_tlv_len;
     char buf[100];
     int i;
 
@@ -502,8 +500,7 @@ ldp_tlv_print(netdissect_options *ndo,
 
                 case LDP_FEC_MARTINI_IFPARM_DESC:
                     ND_PRINT(": ");
-                    for (idx = 2; idx < vc_info_tlv_len; idx++)
-                        fn_print_char(ndo, GET_U_1(tptr + idx));
+                    nd_printjn(ndo, tptr + 2, vc_info_tlv_len - 2);
                     break;
 
                 case LDP_FEC_MARTINI_IFPARM_VCCV:
@@ -689,7 +686,7 @@ ldp_pdu_print(netdissect_options *ndo,
     tptr = pptr + sizeof(struct ldp_common_header);
     tlen = pdu_len - (sizeof(struct ldp_common_header)-4);     /* Type & Length fields not included */
 
-    while(tlen>0) {
+    while(tlen != 0) {
         /* did we capture enough for fully decoding the msg header ? */
         ND_TCHECK_LEN(tptr, sizeof(struct ldp_msg_header));