summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2017-07-27 19:59:47 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2017-07-27 19:59:47 +0000
commit9315a0a45da0ef2f9541a9275b11f72d813aad6a (patch)
tree9f710e5925c539831b66f4752a5285b61dba437b
parent333160ca987bfd48ff164874319e6ea221f24739 (diff)
uint32_t is never < 0; pointed out by clang.
While we originally get a short passed from the kernel, it's probably better for debugging purposes to show what we are actually having which is a uin32_t hence the %u format. OK deraadt
-rw-r--r--usr.bin/netstat/inet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 979750dad8e..3d71dab7063 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet.c,v 1.158 2017/05/16 21:42:14 bluhm Exp $ */
+/* $OpenBSD: inet.c,v 1.159 2017/07/27 19:59:46 florian Exp $ */
/* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */
/*
@@ -339,8 +339,8 @@ netdomainpr(struct kinfo_file *kf, int proto)
inetprint(&faddr, kf->inp_fport, name, 0);
}
if (istcp) {
- if (kf->t_state < 0 || kf->t_state >= TCP_NSTATES)
- printf(" %d", kf->t_state);
+ if (kf->t_state >= TCP_NSTATES)
+ printf(" %u", kf->t_state);
else
printf(" %s", tcpstates[kf->t_state]);
} else if (kf->so_type == SOCK_RAW) {