Date: Thu, 08 Jan 2026 00:11:28 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 292262] netstat: numerous space-padded fields in JSON output Message-ID: <bug-292262-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292262 Bug ID: 292262 Summary: netstat: numerous space-padded fields in JSON output Product: Base System Version: 16.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: asomers@FreeBSD.org netstat has libxo support. But its encoded output forms include numerous fields with space-padding where it doesn't belong. For example: $ netstat -c -p tcp -n --libxo=json,pretty | grep stack | sort | uniq "stack": "bbr " "stack": "freebsd" The common pattern in the code is xo_emit calls with field-format specifiers that include strings with widths, and no encoding-format specifiers. For example, the above lines were caused by: xo_emit(" {:stack/%-*.*s}", Most such instances can be caught by this regex: "xo_emit[^/{]*\{[^}/]*/[^}/]*\}". There are hundreds. -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-292262-227>
