summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-08-09 12:22:32 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-08-09 12:22:32 +0200
commitb38e526c49bcd410908193608291bacd39ac1657 (patch)
treed360258a4e0ddbb50211ce8ea30c42e1a03d184c
parenta2e70ae5b06ac6fa09cce3848c2ed795967b174f (diff)
pcap_rw: Fix compiler warnings
Fix the following compiler warnings that occur when building with "-W -Wall -Wextra": pcap_rw.c: In function ‘pcap_rw_write’: pcap_rw.c:30:6: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pcap_rw.c: In function ‘pcap_rw_read’: pcap_rw.c:50:6: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--pcap_rw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap_rw.c b/pcap_rw.c
index 65b45cb..5a739da 100644
--- a/pcap_rw.c
+++ b/pcap_rw.c
@@ -27,7 +27,7 @@ static ssize_t pcap_rw_write(int fd, pcap_pkthdr_t *phdr, enum pcap_type type,
panic("Failed to write pkt header!\n");
hdrlen = pcap_get_length(phdr, type);
- if (unlikely(hdrlen != len))
+ if (unlikely(hdrlen != (ssize_t) len))
return -EINVAL;
ret = write_or_die(fd, packet, hdrlen);
@@ -47,7 +47,7 @@ static ssize_t pcap_rw_read(int fd, pcap_pkthdr_t *phdr, enum pcap_type type,
return -EIO;
hdrlen = pcap_get_length(phdr, type);
- if (unlikely(hdrlen == 0 || hdrlen > len))
+ if (unlikely(hdrlen == 0 || hdrlen > (ssize_t) len))
return -EINVAL;
ret = read(fd, packet, hdrlen);