]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix printing of 64-bit quantities.
authorGuy Harris <[email protected]>
Fri, 8 Jun 2012 05:12:28 +0000 (22:12 -0700)
committerGuy Harris <[email protected]>
Fri, 8 Jun 2012 05:12:28 +0000 (22:12 -0700)
Do *NOT* assume that "%l[doxu]x" - or "%ll[doxu]" - is the way to print
a 64-bit quantity; on UN*X, it might be a "long" or a "long long",
depending on whether you're on a 32-bit or 64-bit platform and, on
Windows with MSVC++, it's not a long (even in 64-bit mode) and doesn't
use "%ll[doxu]", either.  Instead, use PRI[doxu]64; that's what C99
defines, and what we define ourselves if the C environment doesn't
define it.

print-forces.c

index 8384875f34e95ba9e51b8ed0a2c56475a60be0f9..ec11635bdb336aa62badb8926365165c5e55a0e3 100644 (file)
@@ -1016,7 +1016,7 @@ void forces_print(register const u_char * pptr, register u_int len)
        if (vflag >= 1) {
                printf("\n\tForCES Version %d len %uB flags 0x%08x ",
                       ForCES_V(fhdr), mlen, flg_raw);
-               printf("\n\tSrcID 0x%x(%s) DstID 0x%x(%s) Correlator 0x%lx",
+               printf("\n\tSrcID 0x%x(%s) DstID 0x%x(%s) Correlator 0x%" PRIx64,
                       ForCES_SID(fhdr), ForCES_node(ForCES_SID(fhdr)),
                       ForCES_DID(fhdr), ForCES_node(ForCES_DID(fhdr)),
                       EXTRACT_64BITS(fhdr->fm_cor));