netsniff-ng: Use macros for printf/scanf format specifiers125/head
commited52be1ce3cec81417d48dcd5f9254fba6e13c58
authorJames McCoy <vega.james@gmail.com>
Thu, 1 May 2014 15:14:31 +0000 (1 11:14 -0400)
committerJames McCoy <vega.james@gmail.com>
Fri, 2 May 2014 17:39:10 +0000 (2 13:39 -0400)
tree03ff36cfad0f1cc88c92b7764fd3b8145207d651
parent7231039ec891acee246549410c70f1151a0c0175
netsniff-ng: Use macros for printf/scanf format specifiers

Any types that are fixed width should use the standard format specifier
macros (PRI... for printf-type functions, SCN... for scanf-type
functions) to ensure proper data access.

Prior to this ifpps was crashing in 32-bit environments due to the
following call

mvwprintw(screen, (*voff)++, 2,
  "%s,%s %s (%s%s), t=%lums, cpus=%u%s/%u"
  "               ", uts.release, machine,
  ifname, drvinf.driver, buff, ms_interval, top_cpus,
  top_cpus > 0 && top_cpus < cpus ? "+1" : "", cpus);

since ms_interval is a uint64_t but %lu expects an unsigned long, which
is only 32 bits.

Signed-off-by: James McCoy <vega.james@gmail.com>
flowtop.c
ifpps.c
proto_80211_mac_hdr.c
proto_icmpv6.c
proto_igmp.c
proto_ipv6_mobility_hdr.c
proto_ipv6_routing.c
ring_rx.c
trafgen_parser.y