X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=c892862730c7a826435030f40225da81ab7a491c;hb=6824a483e3bc4a584b998929ac066dda2ae24c8b;hp=7513fa27332c5fcf70cd9d7d286c1f8857d1c8c2;hpb=7cecc449356ec6fc83568488f0968e354b4676b2;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index 7513fa273..c89286273 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -211,7 +211,7 @@ bool userrec::HasPermission(std::string &command) return true; // are they even an oper at all? - if (strchr(this->modes,'o')) + if (*this->oper) { for (int j =0; j < Config->ConfValueEnum("type",&Config->config_f); j++) { @@ -276,7 +276,8 @@ bool userrec::AddBuffer(std::string a) bool userrec::BufferIsReady() { - for (unsigned int i = 0; i < recvq.length(); i++) + unsigned int t = recvq.length(); + for (unsigned int i = 0; i < t; i++) if (recvq[i] == '\n') return true; return false; @@ -293,7 +294,7 @@ std::string userrec::GetBuffer() return ""; char* line = (char*)recvq.c_str(); std::string ret = ""; - while ((*line != '\n') && (strlen(line))) + while ((*line != '\n') && (*line)) { ret = ret + *line; line++; @@ -408,7 +409,14 @@ void kill_link(userrec *user,const char* r) { if (Config->GetIOHook(user->port)) { - Config->GetIOHook(user->port)->OnRawSocketClose(user->fd); + try + { + Config->GetIOHook(user->port)->OnRawSocketClose(user->fd); + } + catch (ModuleException& modexcept) + { + log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \ + } } ServerInstance->SE->DelFd(user->fd); user->CloseSocket(); @@ -471,7 +479,14 @@ void kill_link_silent(userrec *user,const char* r) { if (Config->GetIOHook(user->port)) { - Config->GetIOHook(user->port)->OnRawSocketClose(user->fd); + try + { + Config->GetIOHook(user->port)->OnRawSocketClose(user->fd); + } + catch (ModuleException& modexcept) + { + log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \ + } } ServerInstance->SE->DelFd(user->fd); user->CloseSocket();