diff --git a/capture_loop.c b/capture_loop.c index 4c7dc3a7c1..fdad9599b4 100644 --- a/capture_loop.c +++ b/capture_loop.c @@ -1390,7 +1390,8 @@ capture_loop_packet_cb(guchar *user, const struct pcap_pkthdr *phdr, int err; /* if the user told us to stop after x packets, do we have enough? */ - if ((ld->packets_max > 0) && (++ld->counts.total >= ld->packets_max)) + ld->counts.total++; + if ((ld->packets_max > 0) && (ld->counts.total >= ld->packets_max)) { ld->go = FALSE; }