diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-09-11 19:31:14 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2015-09-11 19:43:26 +0000 |
commit | eca15bf5ae681312e3e94eb7d1aca67e9c7c4b90 (patch) | |
tree | ccc5ea3d8abd038c21f46c129c7f67e991ac4032 | |
parent | b11e9a6e188c5bfac1e22f7b1f34c21c7ea7fe44 (diff) |
androiddump: fix compilation on Windows and OSX
Change-Id: Ie724367b7dacb2a237c02451e14c70442e5be773
Reviewed-on: https://code.wireshark.org/review/10486
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r-- | extcap/androiddump.c | 8 |
1 files 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; } |