diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-08-09 12:22:32 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-08-09 12:22:32 +0200 |
commit | b38e526c49bcd410908193608291bacd39ac1657 (patch) | |
tree | d360258a4e0ddbb50211ce8ea30c42e1a03d184c | |
parent | a2e70ae5b06ac6fa09cce3848c2ed795967b174f (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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |