Mark safe_snprintf and safe_vsnprintf as deprecated, remove uses of them

safe_snprintf and safe_vsnprintf just exist to ensure that the resulting strings are always null-terminated. The documentation for snprintf/vsnprintf states that the output of those methods are always null-terminated, thus making the safe versions obsolete.
This commit is contained in:
Tim Wojtulewicz 2019-12-18 15:58:35 -07:00
parent 6a52857f8f
commit 67fcc9b5af
16 changed files with 31 additions and 29 deletions

View file

@ -62,7 +62,7 @@ void PcapSource::OpenLive()
if ( pcap_findalldevs(&devs, tmp_errbuf) < 0 )
{
safe_snprintf(errbuf, sizeof(errbuf),
snprintf(errbuf, sizeof(errbuf),
"pcap_findalldevs: %s", tmp_errbuf);
Error(errbuf);
return;
@ -75,7 +75,7 @@ void PcapSource::OpenLive()
if ( props.path.empty() )
{
safe_snprintf(errbuf, sizeof(errbuf),
snprintf(errbuf, sizeof(errbuf),
"pcap_findalldevs: empty device name");
Error(errbuf);
return;
@ -83,7 +83,7 @@ void PcapSource::OpenLive()
}
else
{
safe_snprintf(errbuf, sizeof(errbuf),
snprintf(errbuf, sizeof(errbuf),
"pcap_findalldevs: no devices found");
Error(errbuf);
return;
@ -263,7 +263,7 @@ bool PcapSource::SetFilter(int index)
if ( ! code )
{
safe_snprintf(errbuf, sizeof(errbuf),
snprintf(errbuf, sizeof(errbuf),
"No precompiled pcap filter for index %d",
index);
Error(errbuf);