char list[MAXBUF];
size_t dlen = snprintf(list,MAXBUF,"353 %s = %s :", user->nick, c->name);
- int n = 0;
- char* ptr = list + dlen;
+ int numusers = 0;
+ char* ptr = list + dlen - 1;
CUList *ulist= c->GetUsers();
for (char* t = i->second->nick; *t; t++)
*ptr++ = *t;
*ptr++ = ' ';
- n++;
+ numusers++;
if ((ptr - list) > (480-NICKMAX))
{
*--ptr = 0;
WriteServ_NoFormat(user->fd,list);
dlen = snprintf(list,MAXBUF,"353 %s = %s :", user->nick, c->name);
- ptr = list + dlen;
- n = 0;
+ ptr = list + dlen - 1;
+ numusers = 0;
}
}
*--ptr = 0;
/* if whats left in the list isnt empty, send it */
- if (n)
+ if (numusers)
{
WriteServ_NoFormat(user->fd,list);
}
CUList *ulist= c->GetUsers();
for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++)
{
- if (i->second->modebits & UM_INVISIBLE)
+ if (!(i->second->modebits & UM_INVISIBLE))
count++;
}