diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-08-11 14:21:46 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-08-11 14:21:46 +0200 |
commit | b3773742da2d41636c672a838673615a98407746 (patch) | |
tree | 7dc06056e19bf3864d278d5042790ec3983a70e8 | |
parent | b38e526c49bcd410908193608291bacd39ac1657 (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>
-rw-r--r-- | pcap_mm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |