]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Missing a changeover
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index a02d19702272f97fe09fa4cd8c1e4bc2c879d5ec..cae073ff421aa0f29b181a80e7e22da2a4411adb 100644 (file)
@@ -1324,8 +1324,8 @@ void userlist(userrec *user,chanrec *c)
 
        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();
 
@@ -1351,7 +1351,7 @@ void userlist(userrec *user,chanrec *c)
                for (char* t = i->second->nick; *t; t++)
                        *ptr++ = *t;
                *ptr++ = ' ';
-               n++;
+               numusers++;
 
                if ((ptr - list) > (480-NICKMAX))
                {
@@ -1359,14 +1359,14 @@ void userlist(userrec *user,chanrec *c)
                        *--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);
        }
@@ -1386,7 +1386,7 @@ int usercount_i(chanrec *c)
        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++;
        }