Fix calling c_str() for parameters that can take a std::string.

This commit is contained in:
Sadie Powell 2023-05-31 16:46:48 +01:00
parent c4858e2a11
commit 0498e9ad20
6 changed files with 7 additions and 8 deletions

View File

@ -44,7 +44,7 @@ bool InsaneBan::MatchesEveryone(const std::string& mask, MatcherBase& test, User
{
const char* article = strchr("AEIOUaeiou", bantype) ? "an" : "a";
ServerInstance->SNO.WriteToSnoMask('x', "\002WARNING\002: {} tried to set add {} {}-line on {} which covers {:.2}% of the network which is more than the maximum of {:.2}%!",
user->nick.c_str(), article, bantype, mask, percent, itrigger);
user->nick, article, bantype, mask, percent, itrigger);
user->WriteNotice(INSP_FORMAT("*** Unable to add {} {}-line on {} which covers {:.2}% of the network which is more than the maximum of {:.2}%!",
article, bantype, mask, percent, itrigger));
return true;

View File

@ -178,9 +178,8 @@ public:
// The user has tried to change a disabled mode!
const char* what = change.mh->GetModeType() == MODETYPE_CHANNEL ? "channel" : "user";
WriteLog("{} was blocked from {}setting the disabled {} mode {} ({})",
user->GetRealMask().c_str(), change.adding ? "" : "un",
what, change.mh->GetModeChar(), change.mh->name.c_str());
WriteLog("{} was blocked from {}setting the disabled {} mode {} ({})", user->GetRealMask(),
change.adding ? "" : "un", what, change.mh->GetModeChar(), change.mh->name);
if (fakenonexistent)
{

View File

@ -283,7 +283,7 @@ public:
if (newrxengine.empty())
ServerInstance->SNO.WriteToSnoMask('r', "WARNING: No regex engine loaded - R-line functionality disabled until this is corrected.");
else
ServerInstance->SNO.WriteToSnoMask('r', "WARNING: Regex engine '{}' is not loaded - R-line functionality disabled until this is corrected.", newrxengine.c_str());
ServerInstance->SNO.WriteToSnoMask('r', "WARNING: Regex engine '{}' is not loaded - R-line functionality disabled until this is corrected.", newrxengine);
ServerInstance->XLines->DelAll(f.GetType());
}

View File

@ -66,7 +66,7 @@ public:
user->WriteRemoteNumeric(textnumeric, line);
if (!endtext.empty() && endnumeric)
user->WriteRemoteNumeric(endnumeric, endtext.c_str());
user->WriteRemoteNumeric(endnumeric, endtext);
}
else if (IS_LOCAL(user))
{

View File

@ -106,7 +106,7 @@ CmdResult CommandOpertype::HandleRemote(RemoteUser* u, CommandBase::Params& para
if (params.GetTags().find("~name") != params.GetTags().end())
{
extra += INSP_FORMAT(" ({}using account \x02{}\x02)", automatic ? "automatically " : "",
u->oper->GetName().c_str());
u->oper->GetName());
}
ServerInstance->SNO.WriteToSnoMask('O', "From {}: {} ({}) [{}] is now a server operator of type \x02{}\x02{}.",

View File

@ -157,7 +157,7 @@ void SecurityIPResolver::OnError(const DNS::Query* r)
return;
ServerInstance->Logs.Warning(MODNAME, "Could not resolve IP associated with link '{}': {}",
link->Name.c_str(), this->manager->GetErrorStr(r->error).c_str());
link->Name, this->manager->GetErrorStr(r->error));
}
CacheRefreshTimer::CacheRefreshTimer()