From: Tobias Klauser Date: Fri, 9 Aug 2013 09:38:42 +0000 (+0200) Subject: dissector: ip_auth_hdr: Fix compiler warning X-Git-Tag: v0.5.8-rc3~23 X-Git-Url: https://repo.or.cz/w/netsniff-ng.git/commitdiff_plain/cd69ac14e478483f38d8ff9a6671e5f65ef5473a 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 --- diff --git a/proto_ip_authentication_hdr.c b/proto_ip_authentication_hdr.c index 183d4050..2e011639 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)