print ip address when using whoip.
This commit is contained in:
parent
112fa2f845
commit
7b44036480
@ -332,7 +332,7 @@ static int command_whoip(struct hub_info* hub, struct hub_user* user, struct hub
|
|||||||
char tmp[128];
|
char tmp[128];
|
||||||
snprintf(tmp, 128, "Found %d match%s:", (int) ret, ((ret != 1) ? "es" : ""));
|
snprintf(tmp, 128, "Found %d match%s:", (int) ret, ((ret != 1) ? "es" : ""));
|
||||||
|
|
||||||
char* buffer = hub_malloc(((MAX_NICK_LEN + 1) * ret) + strlen(tmp) + 3);
|
char* buffer = hub_malloc(((MAX_NICK_LEN + INET6_ADDRSTRLEN + 5) * ret) + strlen(tmp) + 3);
|
||||||
buffer[0] = 0;
|
buffer[0] = 0;
|
||||||
strcat(buffer, tmp);
|
strcat(buffer, tmp);
|
||||||
strcat(buffer, "\n");
|
strcat(buffer, "\n");
|
||||||
@ -341,7 +341,9 @@ static int command_whoip(struct hub_info* hub, struct hub_user* user, struct hub
|
|||||||
while (u)
|
while (u)
|
||||||
{
|
{
|
||||||
strcat(buffer, u->id.nick);
|
strcat(buffer, u->id.nick);
|
||||||
strcat(buffer, "\n");
|
strcat(buffer, "(");
|
||||||
|
strcat(buffer, ip_convert_to_string(&u->net.ipaddr));
|
||||||
|
strcat(buffer, ")\n");
|
||||||
u = (struct hub_user*) list_get_next(users);
|
u = (struct hub_user*) list_get_next(users);
|
||||||
}
|
}
|
||||||
strcat(buffer, "\n");
|
strcat(buffer, "\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user