diff options
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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); } |