]> The Tcpdump Group git mirrors - tcpdump/commitdiff
We don't define PRIu8 or PRIx8 if the C environment doesn't; don't use it.
authorGuy Harris <[email protected]>
Tue, 26 Mar 2013 09:01:31 +0000 (02:01 -0700)
committerGuy Harris <[email protected]>
Tue, 26 Mar 2013 09:01:59 +0000 (02:01 -0700)
The right format to use to print 8-bit quantities isn't
implementation-dependent, so no need to use the PRIu8 and PRIx8 macros.

There's also no need for an empty string after PRIu64.  Separate it with
space from the strings with which it's being concatenated, however; we
do that elsewhere.

print-zeromq.c

index d5ac4bd3b4487569e3cd681badff6883b6b4a801..10ca2cc4f0490dc6649a638df6e10d62188f9594 100644 (file)
@@ -87,7 +87,7 @@ zmtp1_print_frame(const u_char *cp, const u_char *ep) {
                body_len_declared = cp[0];
                if (body_len_declared == 0)
                        return cp + header_len; /* skip to next frame */
-               printf(" frame flags+body  (8-bit) length %"PRIu8"", cp[0]);
+               printf(" frame flags+body  (8-bit) length %u", cp[0]);
                TCHECK2(*cp, header_len + 1); /* length, flags */
                flags = cp[1];
        } else {
@@ -97,15 +97,15 @@ zmtp1_print_frame(const u_char *cp, const u_char *ep) {
                body_len_declared = EXTRACT_64BITS(cp + 1);
                if (body_len_declared == 0)
                        return cp + header_len; /* skip to next frame */
-               printf(" %"PRIu64"", body_len_declared);
+               printf(" %" PRIu64, body_len_declared);
                TCHECK2(*cp, header_len + 1); /* 0xFF, length, flags */
                flags = cp[9];
        }
 
        body_len_captured = ep - cp - header_len;
        if (body_len_declared > body_len_captured)
-               printf(" (%"PRIu64" captured)", body_len_captured);
-       printf(", flags 0x%02"PRIx8"", flags);
+               printf(" (%" PRIu64 " captured)", body_len_captured);
+       printf(", flags 0x%02x", flags);
 
        if (vflag) {
                u_int64_t body_len_printed = MIN(body_len_captured, body_len_declared);
@@ -123,7 +123,7 @@ zmtp1_print_frame(const u_char *cp, const u_char *ep) {
                if (vflag == 1)
                        body_len_printed = MIN(VBYTES + 1, body_len_printed);
                if (body_len_printed > 1) {
-                       printf(", first %"PRIu64" byte(s) of body:", body_len_printed - 1);
+                       printf(", first %" PRIu64 " byte(s) of body:", body_len_printed - 1);
                        hex_and_ascii_print("\n\t ", cp + header_len + 1, body_len_printed - 1);
                        printf("\n");
                }