{
unsigned int idx = 2;
int numpara = 1;
- const char* modelist[64];
- memset(&modelist,0,sizeof(modelist));
+ std::vector<std::string> modelist;
// Mode parser needs to know what channel to act on.
- modelist[0] = params[0].c_str();
+ modelist[0] = params[0];
/* Remember, params[params.size() - 1] is nicklist, and we don't want to apply *that* */
for (idx = 2; idx != (params.size() - 1); idx++)
{
- modelist[numpara++] = params[idx].c_str();
+ modelist[numpara++] = params[idx];
}
- this->Instance->SendMode(modelist, numpara, this->Instance->FakeClient);
+ this->Instance->SendMode(modelist, this->Instance->FakeClient);
}
/* Now, process every 'modes,nick' pair */
if (apply_other_sides_modes)
{
std::deque<std::string> stackresult;
- const char* mode_junk[MAXMODES+2];
- mode_junk[0] = channel.c_str();
+ std::vector<std::string> mode_junk;
+ mode_junk[0] = channel;
while (modestack.GetStackedLine(stackresult))
{
for (size_t j = 0; j < stackresult.size(); j++)
{
- mode_junk[j+1] = stackresult[j].c_str();
+ mode_junk[j+1] = stackresult[j];
}
- Instance->SendMode(mode_junk, stackresult.size() + 1, Instance->FakeClient);
+ Instance->SendMode(mode_junk, Instance->FakeClient);
}
}
{
irc::modestacker stack(false);
std::deque<std::string> stackresult;
- const char* mode_junk[MAXMODES+2];
+ std::vector<std::string> mode_junk;
mode_junk[0] = c->name;
for (char modeletter = 'A'; modeletter <= 'z'; ++modeletter)
while (stack.GetStackedLine(stackresult))
{
for (size_t j = 0; j < stackresult.size(); j++)
- mode_junk[j+1] = stackresult[j].c_str();
+ mode_junk[j+1] = stackresult[j];
- Instance->SendMode(mode_junk, stackresult.size() + 1, Instance->FakeClient);
+ Instance->SendMode(mode_junk, Instance->FakeClient);
}
}
return true;
smode = true; /* Setting this flag tells us it is a server mode*/
sourceserv = source; /* Set sourceserv to the actual source string */
}
- const char* modelist[64];
+ std::vector<std::string> modelist;
time_t TS = 0;
int n = 0;
- memset(&modelist,0,sizeof(modelist));
for (unsigned int q = 0; (q < params.size()) && (q < 64); q++)
{
if (q == 1)
else
{
/* Everything else is fine to append to the modelist */
- modelist[n++] = params[q].c_str();
+ modelist[n++] = params[q];
}
}
{
if (smode)
{
- this->Instance->SendMode(modelist, n, who);
+ this->Instance->SendMode(modelist, who);
}
else
{
- this->Instance->CallCommandHandler("MODE", modelist, n, who);
+ this->Instance->CallCommandHandler("MODE", modelist, who);
}
/* HOT POTATO! PASS IT ON! */
Utils->DoOneToAllButSender(source,"FMODE",params,sourceserv);