mirror of
https://github.com/znc/znc.git
synced 2026-08-03 15:33:02 +02:00
Fix GetClients() const correctness
It’s dangerous to give a non-const reference to an internal container that the API users are not supposed to modify.
This commit is contained in:
+2
-2
@@ -141,8 +141,8 @@ void CChan::JoinUser(bool bForce, const CString& sKey, CClient* pClient) {
|
||||
CString sLine = sPre;
|
||||
CString sPerm, sNick;
|
||||
|
||||
vector<CClient*>& vpClients = m_pNetwork->GetClients();
|
||||
for (vector<CClient*>::iterator it = vpClients.begin(); it != vpClients.end(); ++it) {
|
||||
const vector<CClient*>& vpClients = m_pNetwork->GetClients();
|
||||
for (vector<CClient*>::const_iterator it = vpClients.begin(); it != vpClients.end(); ++it) {
|
||||
CClient* pThisClient;
|
||||
if (!pClient)
|
||||
pThisClient = *it;
|
||||
|
||||
Reference in New Issue
Block a user