]> The Tcpdump Group git mirrors - libpcap/commitdiff
Check for an empty description by checking if the first character is NUL.
authorGuy Harris <[email protected]>
Fri, 31 May 2019 17:35:25 +0000 (10:35 -0700)
committerGuy Harris <[email protected]>
Fri, 31 May 2019 17:35:25 +0000 (10:35 -0700)
pcap.c

diff --git a/pcap.c b/pcap.c
index d9917a210086f0c50e20a9aecec0bc415a4b946f..0d985199e036691927939e152e4ab9bdb7e8cd13 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -802,7 +802,7 @@ get_if_description(const char *name)
                }
 #endif /* __FreeBSD__ */
                close(s);
-               if (description != NULL && strlen(description) == 0) {
+               if (description != NULL && description[0] == '\0') {
                        /*
                         * Description is empty, so discard it.
                         */