diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-08-09 11:38:42 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-08-09 11:38:42 +0200 |
commit | cd69ac14e478483f38d8ff9a6671e5f65ef5473a (patch) | |
tree | e36e689c77e8a1e9566efb3fd129035fbe0f0e1b /proto_ip_authentication_hdr.c | |
parent | df1d1c89542554db5e184372963b3dfbef3d2007 (diff) |
dissector: ip_auth_hdr: Fix compiler warning
Fix the following compiler warning that occurs when building with "-W
-Wall -Wextra":
ip_authentication_hdr.c: In function ‘auth_hdr’:
proto_ip_authentication_hdr.c:57:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Also remove an unnecessary check for header length smaller than 0, since
it always results from an unsigned type and is now a size_t anyway.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'proto_ip_authentication_hdr.c')
-rw-r--r-- | proto_ip_authentication_hdr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/proto_ip_authentication_hdr.c b/proto_ip_authentication_hdr.c index 183d405..2e01163 100644 --- a/proto_ip_authentication_hdr.c +++ b/proto_ip_authentication_hdr.c @@ -26,8 +26,7 @@ struct auth_hdr { static void auth_hdr(struct pkt_buff *pkt) { - ssize_t hdr_len; - size_t i; + size_t i, hdr_len; struct auth_hdr *auth_ops; auth_ops = (struct auth_hdr *) pkt_pull(pkt, sizeof(*auth_ops)); @@ -38,7 +37,7 @@ static void auth_hdr(struct pkt_buff *pkt) tprintf(" [ Authentication Header "); tprintf("NextHdr (%u), ", auth_ops->h_next_header); - if (hdr_len > pkt_len(pkt) || hdr_len < 0){ + if (hdr_len > pkt_len(pkt)) { tprintf("HdrLen (%u, %zd Bytes %s), ", auth_ops->h_payload_len, hdr_len, colorize_start_full(black, red) |