From bca70575cb3d58127f80d92a388b60b5f5ed2fde Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 30 Mar 2008 02:39:38 +0000 Subject: The bug we fixed for bug #506 may still occur in trunk if a module adjusts the nick and prefix output in the same way via OnNamesListItem, so we really should apply a similar fix here too git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9216 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') 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 */ -- cgit v1.2.3