From: Guy Harris Date: Sat, 9 Feb 2019 23:26:30 +0000 (-0800) Subject: Squelch type-clash warnings. X-Git-Tag: libpcap-1.10-bp~543 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/1cf1e6d8ddd27c768e35d7e646b31ec11f43cddf Squelch type-clash warnings. --- diff --git a/pcap-npf.c b/pcap-npf.c index 81fa4036..9a90455b 100644 --- a/pcap-npf.c +++ b/pcap-npf.c @@ -2044,11 +2044,13 @@ pcap_lib_version(void) * same version of WinPcap), so we report both * versions. */ - if (pcap_asprintf(&pcap_lib_version_string, + char *full_pcap_version_string; + + if (pcap_asprintf(&full_pcap_version_string, WINPCAP_PRODUCT_NAME " version " WINPCAP_VER_STRING " (packet.dll version %s), based on " PCAP_VERSION_STRING, - packet_version_string) == -1) { - /* Failed. */ - pcap_lib_version_string = NULL; + packet_version_string) != -1) { + /* Success */ + pcap_lib_version_string = full_pcap_version_string; } } } @@ -2069,11 +2071,13 @@ pcap_lib_version(void) * Generate the version string. Report the packet.dll * version. */ - if (pcap_asprintf(&pcap_lib_version_string, + char *full_pcap_version_string; + + if (pcap_asprintf(&full_pcap_version_string, PCAP_VERSION_STRING " (packet.dll version %s)", - PacketGetVersion()) == -1) { - /* Failed. */ - pcap_lib_version_string = NULL; + PacketGetVersion()) != -1) { + /* Success */ + pcap_lib_version_string = full_pcap_version_string; } } return (pcap_lib_version_string);