aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-usb-linux.c
diff options
context:
space:
mode:
authorguy <guy>2008-02-02 20:50:31 +0000
committerguy <guy>2008-02-02 20:50:31 +0000
commit988bc0da21b59eb356ba67b957c1d61abddcae81 (patch)
tree8c75e0d1a4bdf7b43be90639043d5998552b39db /pcap-usb-linux.c
parent43b6c2d818975c0515036b69e9f83c5574b47dbc (diff)
Treat a max_packets value of 0 the same way that we treat a max_packets
value of -1.
Diffstat (limited to 'pcap-usb-linux.c')
-rw-r--r--pcap-usb-linux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c
index 5164c8f..2c5a254 100644
--- a/pcap-usb-linux.c
+++ b/pcap-usb-linux.c
@@ -34,7 +34,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.20 2007-12-14 08:02:40 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.21 2008-02-02 20:50:31 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -661,7 +661,7 @@ usb_read_linux_mmap(pcap_t *handle, int max_packets, pcap_handler callback, u_ch
for (;;) {
int i, ret;
int limit = max_packets - packets;
- if (limit < 0)
+ if (limit <= 0)
limit = VEC_SIZE;
if (limit > VEC_SIZE)
limit = VEC_SIZE;
@@ -708,8 +708,8 @@ usb_read_linux_mmap(pcap_t *handle, int max_packets, pcap_handler callback, u_ch
packets++;
}
- /* with max_packets == -1 we stop afer the first chunk*/
- if ((max_packets == -1) || (packets == max_packets))
+ /* with max_packets <= 0 we stop afer the first chunk*/
+ if ((max_packets <= 0) || (packets == max_packets))
break;
}