aboutsummaryrefslogtreecommitdiff
path: root/pcap-linux.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-01-24 10:05:16 -0800
committerGuy Harris <guy@alum.mit.edu>2019-01-24 10:05:16 -0800
commit87c3b959236479979ec262f69890a10caac7e24f (patch)
tree275af2489ab5515f67c37270f4affa97058276e7 /pcap-linux.c
parentf4c3cf29cbb291901258c2f05aba77adab40a686 (diff)
Squelch a compiler warning.
r is known to be >= 0 at that point; just cast it to size_t. Don't treat strcmp() as a Boolean while we're at it (the intent was presumably "{string A} {OP} {string B}" is done as "strcmp({string A}, {string B}) {OP} 0").
Diffstat (limited to 'pcap-linux.c')
-rw-r--r--pcap-linux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index f7c456ff..aa7a330a 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -6978,8 +6978,8 @@ static int iface_dsa_get_proto_info(const char *device, pcap_t *handle,
buf[r] = '\0';
for (i = 0; i < sizeof(dsa_protos) / sizeof(dsa_protos[0]); i++) {
- if (strlen(dsa_protos[i].name) == r &&
- !strcmp(buf, dsa_protos[i].name)) {
+ if (strlen(dsa_protos[i].name) == (size_t)r &&
+ strcmp(buf, dsa_protos[i].name) == 0) {
handle->linktype = dsa_protos[i].linktype;
switch (dsa_protos[i].linktype) {
case DLT_EN10MB: