summaryrefslogtreecommitdiff
path: root/pcap_mm.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-08-11 14:21:46 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-08-11 14:21:46 +0200
commitb3773742da2d41636c672a838673615a98407746 (patch)
tree7dc06056e19bf3864d278d5042790ec3983a70e8 /pcap_mm.c
parentb38e526c49bcd410908193608291bacd39ac1657 (diff)
pcap_mm: Fix compiler warnings
Fix the following compiler warnings that occur when building with "-W -Wall -Wextra": pcap_mm.c: In function ‘pcap_mm_read’: pcap_mm.c:72:73: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pcap_mm.c:79:72: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'pcap_mm.c')
-rw-r--r--pcap_mm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap_mm.c b/pcap_mm.c
index 486fbfe..0c4114e 100644
--- a/pcap_mm.c
+++ b/pcap_mm.c
@@ -69,14 +69,14 @@ static ssize_t pcap_mm_read(int fd __maybe_unused, pcap_pkthdr_t *phdr,
{
size_t hdrsize = pcap_get_hdr_length(phdr, type), hdrlen;
- if (unlikely((off_t) (ptr_va_curr + hdrsize - ptr_va_start) > map_size))
+ if (unlikely((off_t) (ptr_va_curr + hdrsize - ptr_va_start) > (off_t) map_size))
return -EIO;
fmemcpy(&phdr->raw, ptr_va_curr, hdrsize);
ptr_va_curr += hdrsize;
hdrlen = pcap_get_length(phdr, type);
- if (unlikely((off_t) (ptr_va_curr + hdrlen - ptr_va_start) > map_size))
+ if (unlikely((off_t) (ptr_va_curr + hdrlen - ptr_va_start) > (off_t) map_size))
return -EIO;
if (unlikely(hdrlen == 0 || hdrlen > len))
return -EINVAL;