All pastes #962169 Raw Edit

Miscellany

public text v1 · immutable
#962169 ·published 2008-03-29 15:32 UTC
rendered paste body
--- src/channels.cpp	(revision 9202)
+++ src/channels.cpp	(revision 9203)
@@ -880,16 +880,11 @@
 		if (i->first->Visibility && !i->first->Visibility->VisibleTo(user))
 			continue;
 
-		size_t ptrlen = snprintf(ptr, MAXBUF, "%s%s ", this->GetPrefixChar(i->first), i->second.c_str());
+		size_t ptrlen = 0;
 
-		curlen += ptrlen;
-		ptr += ptrlen;
-
-		numusers++;
-
 		/* Fix for bug #506 reported by Skip, often seen by w00t :p */
 		if (curlen > (480-i->second.length()))
-			{
+		{
 			/* list overflowed into multiple numerics */
 			user->WriteServ(std::string(list));
 
@@ -901,6 +896,13 @@
 			numusers = 0;
 		}
 
+		ptrlen = snprintf(ptr, MAXBUF, "%s%s ", this->GetPrefixChar(i->first), i->second.c_str());
+
+		curlen += ptrlen;
+		ptr += ptrlen;
+
+		numusers++;
+
 		/* OnUserList can change this - reset it back to normal */
 		i->second = i->first->nick;
 	}