From 79e607562b1696c284306e5c8c35334a9ad9ef96 Mon Sep 17 00:00:00 2001 From: bluhm Date: Thu, 28 Jul 2016 13:05:52 +0000 Subject: [PATCH] Use long labs(3) for pointer arithmetic. Found by David Hill with clang. --- usr.sbin/tcpdump/print-icmp6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/tcpdump/print-icmp6.c b/usr.sbin/tcpdump/print-icmp6.c index 4e8caed0294..5823fd4c11b 100644 --- a/usr.sbin/tcpdump/print-icmp6.c +++ b/usr.sbin/tcpdump/print-icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-icmp6.c,v 1.20 2016/05/07 19:36:45 jca Exp $ */ +/* $OpenBSD: print-icmp6.c,v 1.21 2016/07/28 13:05:52 bluhm Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994 @@ -452,7 +452,7 @@ icmp6_print(const u_char *bp, u_int length, const u_char *bp2) mode = FQDN; } } - if (mode == UNKNOWN && 2 < abs(buf[12] - (ep - buf - 13))) + if (mode == UNKNOWN && 2 < labs(buf[12] - (ep - buf - 13))) mode = WRU; if (mode == UNKNOWN) mode = FQDN; -- 2.20.1