aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-nit.c
diff options
context:
space:
mode:
authorguy <guy>2008-02-02 20:58:18 +0000
committerguy <guy>2008-02-02 20:58:18 +0000
commitee4fa22844bf901836fb01d2c62933db21f02094 (patch)
tree8e4206e9d847d483593c3bcc2add040e22ed5d6e /pcap-nit.c
parent2acadd544c2e040e10d681d6af605543daf730e9 (diff)
As is done in the loop in pcap-bpf.c, check for non-positive values of
"cnt", not for non-negative values, so a "cnt" of 0 is treated the same as a "cnt" of -1.
Diffstat (limited to 'pcap-nit.c')
-rw-r--r--pcap-nit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap-nit.c b/pcap-nit.c
index 1e16ab4..4cc122e 100644
--- a/pcap-nit.c
+++ b/pcap-nit.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.59 2007-12-05 23:37:26 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.60 2008-02-02 20:58:18 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -180,7 +180,7 @@ pcap_read_nit(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
h.len = nh->nh_wirelen;
h.caplen = caplen;
(*callback)(user, &h, cp);
- if (++n >= cnt && cnt >= 0) {
+ if (++n >= cnt && cnt > 0) {
p->cc = ep - bp;
p->bp = bp;
return (n);