1
0
forked from bip/bip

buf manipulation fixes

This commit is contained in:
nohar 2006-07-02 12:57:23 +00:00
parent b4d73d22da
commit 2ba9ccac5c

View File

@ -982,18 +982,20 @@ void write_user_list(connection_t *c, char *dest)
hash_iterator_t it;
list_iterator_t lit;
char buf[4096];
WRITE_LINE2(c, P_IRCMASK, "PRIVMSG", dest, "bip user list:");
for (hash_it_init(&conf_users, &it); hash_it_item(&it);
hash_it_next(&it)) {
struct c_user *u = hash_it_item(&it);
snprintf(buf, 4095, "* %s:", u->name);
buf[4095] = 0;
WRITE_LINE2(c, P_IRCMASK, "PRIVMSG", dest, buf);
for (list_it_init(&u->connectionl, &lit); list_it_item(&lit);
list_it_next(&lit)) {
struct c_connection *con = list_it_item(&lit);
snprintf(buf, 4095, " - %s", con->name);
buf[4095] = 0;
WRITE_LINE2(c, P_IRCMASK, "PRIVMSG", dest, buf);
}
}