]> The Tcpdump Group git mirrors - tcpdump/commitdiff
justify MIN()/min() further (complements dbfdf97)
authorDenis Ovsienko <[email protected]>
Sat, 15 Mar 2014 19:30:58 +0000 (23:30 +0400)
committerDenis Ovsienko <[email protected]>
Sat, 15 Mar 2014 19:31:48 +0000 (23:31 +0400)
print-olsr.c
print-rpki-rtr.c
print-zeromq.c

index a7fe219784f32df73b32750f0bb58287e7cf862f..6b4e2ac72eb66d5bd68528abcd4deeb784566c86 100644 (file)
@@ -277,7 +277,7 @@ olsr_print (const u_char *pptr, u_int length, int is_ipv6)
     }
 
     ptr.common = (struct olsr_common *)tptr;
-    length = MIN(length, EXTRACT_16BITS(ptr.common->packet_len));
+    length = min(length, EXTRACT_16BITS(ptr.common->packet_len));
 
     printf("OLSRv%i, seq 0x%04x, length %u",
             (is_ipv6 == 0) ? 4 : 6,
index 62c4a8806f6e3dc74e80c218736e3a33a0670b29..5502ebb4cd47bae42ef7869a92ef7656f12964b0 100644 (file)
@@ -287,7 +287,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, u_int indent)
                tlen -= 4;
            }
            if (text_length && (text_length <= tlen )) {
-               memcpy(buf, tptr, MIN(sizeof(buf)-1, text_length));
+               memcpy(buf, tptr, min(sizeof(buf)-1, text_length));
                buf[text_length] = '\0';
                ND_PRINT((ndo, "%sError text: %s", indent_string(indent+2), buf));
            }
index 1f31163a0a0616d5afda61b7690a5f7b146af6a9..9c5bb354a8337b24e66eb46188d5927673697000 100644 (file)
@@ -109,7 +109,7 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
        ND_PRINT((ndo, ", flags 0x%02x", flags));
 
        if (ndo->ndo_vflag) {
-               u_int64_t body_len_printed = MIN(body_len_captured, body_len_declared);
+               u_int64_t body_len_printed = min(body_len_captured, body_len_declared);
 
                ND_PRINT((ndo, " (%s|%s|%s|%s|%s|%s|%s|%s)",
                        flags & 0x80 ? "MBZ" : "-",
@@ -122,7 +122,7 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
                        flags & 0x01 ? "MORE" : "-"));
 
                if (ndo->ndo_vflag == 1)
-                       body_len_printed = MIN(VBYTES + 1, body_len_printed);
+                       body_len_printed = min(VBYTES + 1, body_len_printed);
                if (body_len_printed > 1) {
                        ND_PRINT((ndo, ", first %" PRIu64 " byte(s) of body:", body_len_printed - 1));
                        hex_and_ascii_print(ndo, "\n\t ", cp + header_len + 1, body_len_printed - 1);
@@ -140,7 +140,7 @@ trunc:
 
 void
 zmtp1_print(netdissect_options *ndo, const u_char *cp, u_int len) {
-       const u_char *ep = MIN(ndo->ndo_snapend, cp + len);
+       const u_char *ep = min(ndo->ndo_snapend, cp + len);
 
        ND_PRINT((ndo, ": ZMTP/1.0"));
        while (cp < ep)
@@ -190,7 +190,7 @@ zmtp1_print_intermediate_part(netdissect_options *ndo, const u_char *cp, const u
                        u_int64_t len_printed = min(frame_offset, remaining_len);
 
                        if (ndo->ndo_vflag == 1)
-                               len_printed = MIN(VBYTES, len_printed);
+                               len_printed = min(VBYTES, len_printed);
                        if (len_printed > 1) {
                                ND_PRINT((ndo, ", first %"PRIu64" byte(s):", len_printed));
                                hex_and_ascii_print(ndo, "\n\t ", cp, len_printed);