]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use PRIx64 to print a 64-bit number in hex.
authorGuy Harris <[email protected]>
Fri, 29 Jul 2016 20:00:48 +0000 (13:00 -0700)
committerGuy Harris <[email protected]>
Fri, 29 Jul 2016 20:00:48 +0000 (13:00 -0700)
"lx" doesn't work on ILP32 or LLP64 platforms.

print-hncp.c

index cca45f540c50481be292bd0c42cc6d41ade3f5e5..7bcc749436affc6fc55570bc891dd9ef99c04a69 100644 (file)
@@ -151,7 +151,7 @@ format_256(const u_char *data)
     static char buf[4][64+5];
     static int i = 0;
     i = (i + 1) % 4;
-    snprintf(buf[i], 28, "%016lx%016lx%016lx%016lx",
+    snprintf(buf[i], 28, "%016" PRIx64 "%016" PRIx64 "%016" PRIx64 "%016" PRIx64,
          EXTRACT_64BITS(data),
          EXTRACT_64BITS(data + 8),
          EXTRACT_64BITS(data + 16),
@@ -467,7 +467,7 @@ hncp_print_rec(netdissect_options *ndo,
             if (bodylen != 8)
                 goto invalid;
             hash = EXTRACT_64BITS(value);
-            ND_PRINT((ndo, " hash: %016lx", hash));
+            ND_PRINT((ndo, " hash: %016" PRIx64, hash));
         }
             break;
 
@@ -481,7 +481,7 @@ hncp_print_rec(netdissect_options *ndo,
             sequence_number = EXTRACT_32BITS(value + 4);
             time = format_interval(EXTRACT_32BITS(value + 8));
             hash = EXTRACT_64BITS(value + 12);
-            ND_PRINT((ndo, " NID: %s seqno: %u %s hash: %016lx",
+            ND_PRINT((ndo, " NID: %s seqno: %u %s hash: %016" PRIx64,
                 node_identifier,
                 sequence_number,
                 time,