summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/scope.c b/scope.c
index 1919569..73a0858 100644
--- a/scope.c
+++ b/scope.c
@@ -1011,11 +1011,19 @@ ServerHalf(FD fd)
const char *
ClientName(FD fd)
{
- static char name[12];
+ static char name[62];
+ unsigned pos = 0;
+ const char *peer_info;
if (clientNumber <= 1)
- return ("");
- snprintf(name, sizeof(name), " %d", FDinfo[fd].ClientNumber);
+ name[0] = '\0';
+ else
+ pos = snprintf(name, sizeof(name), " %d", FDinfo[fd].ClientNumber);
+
+ peer_info = GetPeerInfo(fd);
+ if (peer_info)
+ snprintf(name + pos, sizeof(name) - pos, " (%s)", peer_info);
+
return (name);
}