aboutsummaryrefslogtreecommitdiff
path: root/pcap-linux.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <fx.lebail@yahoo.com>2015-09-02 21:44:55 +0200
committerFrancois-Xavier Le Bail <fx.lebail@yahoo.com>2015-09-02 21:44:55 +0200
commitc83db957486759f52f92fa3cbf1d3854b47215b1 (patch)
tree1548e523c4a11303d39adacc4e6d4f5e4b69dac0 /pcap-linux.c
parent672dc725b71ba643bffaa331590cfd99c30f7a64 (diff)
Fix warning as "ISO C90 forbids mixed declarations and code"
Diffstat (limited to 'pcap-linux.c')
-rw-r--r--pcap-linux.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index 1f975370..d5735699 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -4983,6 +4983,8 @@ again:
/* non-positive values of max_packets are used to require all
* packets currently available in the ring */
while ((pkts < max_packets) || PACKET_COUNT_IS_UNLIMITED(max_packets)) {
+ int packets_to_read;
+
if (handlep->current_packet == NULL) {
h.raw = RING_GET_CURRENT_FRAME(handle);
if (h.h3->hdr.bh1.block_status == TP_STATUS_KERNEL)
@@ -4991,7 +4993,7 @@ again:
handlep->current_packet = h.raw + h.h3->hdr.bh1.offset_to_first_pkt;
handlep->packets_left = h.h3->hdr.bh1.num_pkts;
}
- int packets_to_read = handlep->packets_left;
+ packets_to_read = handlep->packets_left;
if (!PACKET_COUNT_IS_UNLIMITED(max_packets) && packets_to_read > max_packets) {
packets_to_read = max_packets;