]> The Tcpdump Group git mirrors - libpcap/commitdiff
Squelch type-clash warnings.
authorGuy Harris <[email protected]>
Sat, 9 Feb 2019 23:26:30 +0000 (15:26 -0800)
committerGuy Harris <[email protected]>
Sat, 9 Feb 2019 23:26:30 +0000 (15:26 -0800)
pcap-npf.c

index 81fa4036387e2536bbce6e2b544220e02e008811..9a90455bd989c575e66e789cb2d48e6a205d3873 100644 (file)
@@ -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);