From eca15bf5ae681312e3e94eb7d1aca67e9c7c4b90 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Fri, 11 Sep 2015 19:31:14 +0200 Subject: androiddump: fix compilation on Windows and OSX Change-Id: Ie724367b7dacb2a237c02451e14c70442e5be773 Reviewed-on: https://code.wireshark.org/review/10486 Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin --- extcap/androiddump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extcap/androiddump.c b/extcap/androiddump.c index 8c581bb47f..5df1588321 100644 --- a/extcap/androiddump.c +++ b/extcap/androiddump.c @@ -2350,7 +2350,7 @@ static int capture_android_wifi_tcpdump(char *interface, char *fifo, while (endless_loop) { char *i_position; errno = 0; - length = recv(sock, data + used_buffer_length, PACKET_LENGTH - used_buffer_length, 0); + length = recv(sock, data + used_buffer_length, (int)(PACKET_LENGTH - used_buffer_length), 0); if (errno == EAGAIN || errno == EWOULDBLOCK) continue; else if (errno != 0) { @@ -2389,7 +2389,7 @@ static int capture_android_wifi_tcpdump(char *interface, char *fifo, */ filter_buffer_length=0; while (endless_loop) { - guint i = 0,read_offset,j=0; + gssize i = 0,read_offset,j=0; /*Filter the received data to get rid of unwanted 0DOA*/ for (i = 0; i < (used_buffer_length - 1); i++) { if (data[i] == 0x0d && data[i + 1] == 0x0a) { @@ -2431,7 +2431,7 @@ static int capture_android_wifi_tcpdump(char *interface, char *fifo, p_header.orig_len = GUINT32_SWAP_LE_BE(*(guint32*)(packet +12)); } - if (p_header.incl_len + PCAP_RECORD_HEADER_LENGTH <= filter_buffer_length) { + if ((gssize)(p_header.incl_len + PCAP_RECORD_HEADER_LENGTH) <= filter_buffer_length) { /* * It was observed that some times tcpdump reports the length of packet as '0' and that leads to the @@ -2462,7 +2462,7 @@ static int capture_android_wifi_tcpdump(char *interface, char *fifo, /*Get the data from the tcpdump process running in the android device*/ while (endless_loop) { errno = 0; - length = recv(sock, data + used_buffer_length,PACKET_LENGTH -(used_buffer_length + filter_buffer_length), 0); + length = recv(sock, data + used_buffer_length, (int)(PACKET_LENGTH -(used_buffer_length + filter_buffer_length)), 0); if (errno == EAGAIN || errno == EWOULDBLOCK) { continue; } -- cgit v1.2.3