From: Guy Harris Date: Fri, 31 May 2019 17:35:25 +0000 (-0700) Subject: Check for an empty description by checking if the first character is NUL. X-Git-Tag: libpcap-1.10-bp~485 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/593769c3637583653bafa924fe348115016618c3 Check for an empty description by checking if the first character is NUL. --- diff --git a/pcap.c b/pcap.c index d9917a21..0d985199 100644 --- 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. */