From 98fd8145d87a16a8bca10102f42fe0de954af967 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 9 Mar 2006 12:23:04 +0000 Subject: Fixed to correctly use iterator git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3583 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 4db389957..5c1d78fb0 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -113,18 +113,19 @@ userrec::userrec() sendq = ""; chans.clear(); invites.clear(); - clientlist[tempnick]->chans.resize(MAXCHANS); + chans.resize(MAXCHANS); for (unsigned int n = 0; n < MAXCHANS; n++) - { - clientlist[tempnick]->chans[n] = new ucrec(); - clientlist[tempnick]->chans[n]->channel = NULL; - clientlist[tempnick]->chans[n]->uc_modes = 0; + { + ucrec* x = new ucrec(); + chans[n] = x; + x->channel = NULL; + x->uc_modes = 0; } } userrec::~userrec() { - for (std::vector::iterator n = clientlist[tempnick]->chans.begin(); n != clientlist[tempnick]->chans.end(); n++) + for (std::vector::iterator n = chans.begin(); n != chans.end(); n++) { ucrec* x = (ucrec*)*n; delete x; -- cgit v1.3.1-10-gc9f91