diff options
| author | 2008-03-29 15:02:06 +0000 | |
|---|---|---|
| committer | 2008-03-29 15:02:06 +0000 | |
| commit | 77b933f6ecddbffd0db5a0c8fc444b4c8bfbfb11 (patch) | |
| tree | ea97d48681effbefac250bcffa4d99aa05492f05 /src/modules/m_namesx.cpp | |
| parent | Fix for bug #506 reported by Skip (diff) | |
We also need to re-order to make sure the length comprison comes BEFORE the append: different items may have different lengths and otherwise we'd be comparing length of the LAST item not the current
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@9203 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_namesx.cpp')
| -rw-r--r-- | src/modules/m_namesx.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp index 4118d2101..cd56ea52c 100644 --- a/src/modules/m_namesx.cpp +++ b/src/modules/m_namesx.cpp @@ -95,11 +95,7 @@ class ModuleNamesX : public Module if (i->first->Visibility && !i->first->Visibility->VisibleTo(user)) continue; - size_t ptrlen = snprintf(ptr, MAXBUF, "%s%s ", Ptr->GetAllPrefixChars(i->first), i->second.c_str()); - /* OnUserList can change this - reset it back to normal */ - curlen += ptrlen; - ptr += ptrlen; - numusers++; + size_t ptrlen = 0; /* Fix for bug #506 reported by Skip, often seen by w00t :p */ if (curlen > (480-i->second.length())) @@ -113,6 +109,14 @@ class ModuleNamesX : public Module numusers = 0; } + ptrlen = snprintf(ptr, MAXBUF, "%s%s ", Ptr->GetAllPrefixChars(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; } /* if whats left in the list isnt empty, send it */ |
