]> The Tcpdump Group git mirrors - tcpdump/commit
Add PRIsize, to use as the print format for size_t
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 3 Aug 2019 14:14:22 +0000 (16:14 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 3 Aug 2019 14:24:04 +0000 (16:24 +0200)
commit40f1cf8aa72185cce0994aaaf8b14d524e5a4d8b
treea2d1d376142e73a15dda2e2dcaa32c40d818f778
parent64ab4a9e04c8f92871a9c3a89b91ddf3498741c3
Add PRIsize, to use as the print format for size_t

size_t may be bigger than unsigned long, so don't just cast to unsigned
long and print with %lu".  (In practice, the value is unlikely to be
bigger, but this is cleaner.)

We could use %zu on UN*X, as we require C99 support and C99 requires
support for z as a size modifier, but MSVC doesn't support z as a size
modifier until Visual Studio 2017.

Updated from:
libpcap/commit/e217f88289b9601e3a9a8d13477f867bcb83b5e2
netdissect-stdinc.h