X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_pass.cpp;h=b9b55d007aba5a7bdf5e7d96eda6740f862dafda;hb=cf83031f7bf1c037bf726df84f93686b9631531b;hp=fc09d2a414b567100aa608e74583b49146db98b2;hpb=dd36852a52e8541306b76c5b88bce8ab9b36654c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_pass.cpp b/src/commands/cmd_pass.cpp index fc09d2a41..b9b55d007 100644 --- a/src/commands/cmd_pass.cpp +++ b/src/commands/cmd_pass.cpp @@ -19,23 +19,21 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandPass(Instance); } -CmdResult CommandPass::Handle (const char* const* parameters, int, User *user) +CmdResult CommandPass::Handle (const std::vector& parameters, User *user) { // Check to make sure they havnt registered -- Fix by FCS if (user->registered == REG_ALL) { - user->WriteServ("462 %s :You may not reregister",user->nick); + user->WriteNumeric(462, "%s :You may not reregister",user->nick.c_str()); return CMD_FAILURE; } ConnectClass* a = user->GetClass(); if (!a) return CMD_FAILURE; - strlcpy(user->password,parameters[0],63); - if (!ServerInstance->PassCompare(user, a->GetPass().c_str(), parameters[0], a->GetHash().c_str())) - { + user->password.assign(parameters[0], 0, 63); + if (!ServerInstance->PassCompare(user, a->GetPass().c_str(), parameters[0].c_str(), a->GetHash().c_str())) user->haspassed = true; - } return CMD_SUCCESS; }