tcpdump mailing list archives

Re: snprintf in libpcap


From: Guy Harris via tcpdump-workers <tcpdump-workers () lists tcpdump org>
Date: Mon, 2 Mar 2020 16:51:09 -0500 (EST)

--- Begin Message --- From: Guy Harris <gharris () sonic net>
Date: Mon, 2 Mar 2020 13:51:55 -0800
On Mar 2, 2020, at 1:22 PM, Michael Richardson via tcpdump-workers <tcpdump-workers () lists tcpdump org> wrote:

Back in 2016, we note in the CHANGES:
  Replace sprintf() with pcap_snprintf().

but, we have no prototype for this, and apparently no definition, and we use
snprintf() everywhere.  I'm trying to merge Ray's changes which are rebased
into pull request #914.

I think that we just use "snprintf()" now.

In the master branch, we require versions of Visual Studio that support a C99-compatible snprintf(), and we also 
require C99-compatible snprintf() support on UN*Xes.

Earlier versions 1) had pcap_snprintf() and 2) either declared it and provided it, or just #defined pcap_snprintf to be 
snprintf.

Note that #914 also uses structure initializations that initialize fields by name, which is also a C99-ism and which I 
think sufficiently recent versions of Visual Studio support; I'm OK with requiring support for that (1990 called, it 
wants its C standard back...).

--- End Message ---
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Current thread: