diff options
-rw-r--r-- | src/channels.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index ebd317e1d..15288ef09 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -895,12 +895,7 @@ void Channel::UserList(User *user, CUList *ulist) continue; } - size_t ptrlen = snprintf(ptr, MAXBUF, "%s%s ", prefixlist.c_str(), nick.c_str()); - - curlen += ptrlen; - ptr += ptrlen; - - numusers++; + size_t ptrlen = 0; if (curlen > (480-NICKMAX)) { @@ -914,6 +909,13 @@ void Channel::UserList(User *user, CUList *ulist) ptrlen = 0; numusers = 0; } + + ptrlen = snprintf(ptr, MAXBUF, "%s%s ", prefixlist.c_str(), nick.c_str()); + + curlen += ptrlen; + ptr += ptrlen; + + numusers++; } /* if whats left in the list isnt empty, send it */ |