print ip address when using whoip.

This commit is contained in:
Jan Vidar Krey 2009-07-26 06:30:48 +02:00
parent 112fa2f845
commit 7b44036480
1 changed files with 4 additions and 2 deletions

View File

@ -332,7 +332,7 @@ static int command_whoip(struct hub_info* hub, struct hub_user* user, struct hub
char tmp[128];
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;
strcat(buffer, tmp);
strcat(buffer, "\n");
@ -341,7 +341,9 @@ static int command_whoip(struct hub_info* hub, struct hub_user* user, struct hub
while (u)
{
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);
}
strcat(buffer, "\n");