summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2016-02-02 22:27:48 +0000
committergjb <gjb@FreeBSD.org>2016-02-02 22:27:48 +0000
commitefd5551e55b056811a107b33e1c30676ee37d0e8 (patch)
tree5ea64f05cc16d8a5032524fdefec823e707e1ff3 /usr.bin/netstat
parenta6998ad84f9722c560a80302a74fa495e818a153 (diff)
parent6d511d769313fd1dae574a1d395369df219e86b6 (diff)
downloadFreeBSD-src-efd5551e55b056811a107b33e1c30676ee37d0e8.zip
FreeBSD-src-efd5551e55b056811a107b33e1c30676ee37d0e8.tar.gz
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/inet.c6
-rw-r--r--usr.bin/netstat/sctp.c5
-rw-r--r--usr.bin/netstat/unix.c8
3 files changed, 10 insertions, 9 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 6a93314..b0a0a7f 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -486,11 +486,11 @@ protopr(u_long off, const char *name, int af1, int proto)
else
xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", name, vchar);
if (Lflag) {
- char buf1[15];
+ char buf1[33];
- snprintf(buf1, 15, "%d/%d/%d", so->so_qlen,
+ snprintf(buf1, sizeof buf1, "%u/%u/%u", so->so_qlen,
so->so_incqlen, so->so_qlimit);
- xo_emit("{:listen-queue-sizes/%-14.14s} ", buf1);
+ xo_emit("{:listen-queue-sizes/%-32.32s} ", buf1);
} else if (Tflag) {
if (istcp)
xo_emit("{:sent-retransmit-packets/%6u} "
diff --git a/usr.bin/netstat/sctp.c b/usr.bin/netstat/sctp.c
index 5f609a0..6c766b2 100644
--- a/usr.bin/netstat/sctp.c
+++ b/usr.bin/netstat/sctp.c
@@ -467,9 +467,10 @@ sctp_process_inpcb(struct xsctp_inpcb *xinpcb,
tname = "????";
if (Lflag) {
- char buf1[9];
+ char buf1[22];
- snprintf(buf1, 9, "%hu/%hu", xinpcb->qlen, xinpcb->maxqlen);
+ snprintf(buf1, sizeof buf1, "%u/%u",
+ xinpcb->qlen, xinpcb->maxqlen);
xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
pname, tname);
xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}"
diff --git a/usr.bin/netstat/unix.c b/usr.bin/netstat/unix.c
index a7503f5..04e4ae5 100644
--- a/usr.bin/netstat/unix.c
+++ b/usr.bin/netstat/unix.c
@@ -271,7 +271,7 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so)
struct unpcb *unp;
struct sockaddr_un *sa;
static int first = 1;
- char buf1[15];
+ char buf1[33];
static const char *titles[2] = {
"{T:/%-8.8s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%8.8s} "
"{T:/%8.8s} {T:/%8.8s} {T:/%8.8s} {T:Addr}\n",
@@ -310,10 +310,10 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so)
return;
if (Lflag) {
- snprintf(buf1, 15, "%d/%d/%d", so->so_qlen,
+ snprintf(buf1, sizeof buf1, "%u/%u/%u", so->so_qlen,
so->so_incqlen, so->so_qlimit);
- xo_emit("unix {d:socket/%-14.14s}{e:queue-length/%d}"
- "{e:incomplete-queue-length/%d}{e:queue-limit/%d}",
+ xo_emit("unix {d:socket/%-32.32s}{e:queue-length/%u}"
+ "{e:incomplete-queue-length/%u}{e:queue-limit/%u}",
buf1, so->so_qlen, so->so_incqlen, so->so_qlimit);
} else {
xo_emit(format[fmt],
OpenPOWER on IntegriCloud