From cd69ac14e478483f38d8ff9a6671e5f65ef5473a Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 9 Aug 2013 11:38:42 +0200 Subject: [PATCH] dissector: ip_auth_hdr: Fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- proto_ip_authentication_hdr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) -- 2.11.4.GIT