git: b016fa60c87f - stable/13 - sockstat: improve printaddr() according to style(9)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 19 Jan 2026 22:13:37 UTC
The branch stable/13 has been updated by michaelo:
URL: https://cgit.FreeBSD.org/src/commit/?id=b016fa60c87f9806e76c2992aae1dedd4a7fedd4
commit b016fa60c87f9806e76c2992aae1dedd4a7fedd4
Author: Michael Osipov <michaelo@FreeBSD.org>
AuthorDate: 2025-12-29 21:31:49 +0000
Commit: Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-01-19 22:13:23 +0000
sockstat: improve printaddr() according to style(9)
Reviewed by: des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D54412
(cherry picked from commit f89f7e58ba1d54c6a683e3cc899938895496c088)
---
usr.bin/sockstat/sockstat.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c
index d024c983a84b..fed63d6031f3 100644
--- a/usr.bin/sockstat/sockstat.c
+++ b/usr.bin/sockstat/sockstat.c
@@ -853,7 +853,7 @@ static int
printaddr(struct sockaddr_storage *ss)
{
struct sockaddr_un *sun;
- char addrstr[NI_MAXHOST] = { '\0', '\0' };
+ char addrstr[NI_MAXHOST] = "";
int error, off, port = 0;
switch (ss->ss_family) {
@@ -879,9 +879,9 @@ printaddr(struct sockaddr_storage *ss)
errx(1, "getnameinfo()");
}
if (port == 0)
- return xprintf("%s:*", addrstr);
+ return (xprintf("%s:*", addrstr));
else
- return xprintf("%s:%d", addrstr, port);
+ return (xprintf("%s:%d", addrstr, port));
}
static const char *