]> The Tcpdump Group git mirrors - libpcap/blobdiff - fad-getad.c
Add a routine to format error messages with an errno-based message at the end.
[libpcap] / fad-getad.c
index c2c3e43db76934116351d7acdf7fe6aa1028b002..75797450c6e48672a01d421ea58ed328de1b8b71 100644 (file)
@@ -168,8 +168,8 @@ pcap_findalldevs_interfaces(pcap_if_list_t *devlistp, char *errbuf,
         * those.
         */
        if (getifaddrs(&ifap) != 0) {
-               (void)pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE,
-                   "getifaddrs: %s", pcap_strerror(errno));
+               pcap_fmt_errmsg_for_errno(errbuf, PCAP_ERRBUF_SIZE,
+                   errno, "getifaddrs");
                return (-1);
        }
        for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {