Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154430069
D54412.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
810 B
Referenced Files
None
Subscribers
None
D54412.diff
View Options
diff --git a/usr.bin/sockstat/main.c b/usr.bin/sockstat/main.c
--- a/usr.bin/sockstat/main.c
+++ b/usr.bin/sockstat/main.c
@@ -926,8 +926,8 @@
formataddr(struct sockaddr_storage *ss, char *buf, size_t bufsize)
{
struct sockaddr_un *sun;
- char addrstr[NI_MAXHOST] = { '\0', '\0' };
int error, off, port = 0;
+ char addrstr[NI_MAXHOST] = "";
switch (ss->ss_family) {
case AF_INET:
@@ -960,11 +960,11 @@
if (is_xo_style_encoding) {
xo_emit("{:address/%s}", addrstr);
xo_emit("{:port/%d}", port);
- return 0;
+ return (0);
}
if (port == 0)
- return snprintf(buf, bufsize, "%s:*", addrstr);
- return snprintf(buf, bufsize, "%s:%d", addrstr, port);
+ return (snprintf(buf, bufsize, "%s:*", addrstr));
+ return (snprintf(buf, bufsize, "%s:%d", addrstr, port));
}
static const char *
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 29, 12:17 PM (6 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32274544
Default Alt Text
D54412.diff (810 B)
Attached To
Mode
D54412: sockstat: improve code style
Attached
Detach File
Event Timeline
Log In to Comment