summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2016-07-28 13:05:52 +0000
committerbluhm <bluhm@openbsd.org>2016-07-28 13:05:52 +0000
commit79e607562b1696c284306e5c8c35334a9ad9ef96 (patch)
treea519b63f020f4f602402ca60423c0f146ecd51d8
parentRevert previous commit (diff)
downloadwireguard-openbsd-79e607562b1696c284306e5c8c35334a9ad9ef96.tar.xz
wireguard-openbsd-79e607562b1696c284306e5c8c35334a9ad9ef96.zip
Use long labs(3) for pointer arithmetic.
Found by David Hill with clang.
-rw-r--r--usr.sbin/tcpdump/print-icmp6.c4
1 files 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;