From: Guy Harris Date: Mon, 25 Jul 2016 00:24:54 +0000 (-0700) Subject: Squelch signed vs. unsigned comparison warnings. X-Git-Tag: libpcap-1.8.1~159 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/406cfb76981a17b900cae43d3bbab7b5dae75900 Squelch signed vs. unsigned comparison warnings. We know len is >= 1, hence > 0, at that point, so just cast it to unsigned. --- diff --git a/bpf/net/bpf_filter.c b/bpf/net/bpf_filter.c index 9abbd540..c6660877 100644 --- a/bpf/net/bpf_filter.c +++ b/bpf/net/bpf_filter.c @@ -633,7 +633,7 @@ bpf_validate(f, len) return 0; #endif - for (i = 0; i < len; ++i) { + for (i = 0; i < (u_int)len; ++i) { p = &f[i]; switch (BPF_CLASS(p->code)) { /*