summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-03 01:52:59 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-03 01:52:59 +0000
commitde25d946733f774e3a5b53a58438a9c92af0acbe (patch)
tree459ccc3b0c2423f1592afec4b458615968a1176d /src/modules/m_spanningtree
parente57ed15735a3f23d6451845c7cf96758e6909d8c (diff)
Get rid of a bunch of memory-wasting C-style strings
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11796 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp4
-rw-r--r--src/modules/m_spanningtree/opertype.cpp5
-rw-r--r--src/modules/m_spanningtree/override_map.cpp6
-rw-r--r--src/modules/m_spanningtree/uid.cpp2
4 files changed, 7 insertions, 10 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 8b9f40e0b..7d6974cf0 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -91,7 +91,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
return;
user->WriteNumeric(364, "%s %s %s :%d %s", user->nick.c_str(),Current->GetName().c_str(),
- (Utils->FlatLinks && (!IS_OPER(user))) ? ServerInstance->Config->ServerName : Parent.c_str(),
+ (Utils->FlatLinks && (!IS_OPER(user))) ? ServerInstance->Config->ServerName.c_str() : Parent.c_str(),
(Utils->FlatLinks && (!IS_OPER(user))) ? 0 : hops,
Current->GetDesc().c_str());
}
@@ -829,7 +829,7 @@ void ModuleSpanningTree::OnAddLine(User* user, XLine *x)
char data[MAXBUF];
snprintf(data,MAXBUF,"%s %s %s %lu %lu :%s", x->type.c_str(), x->Displayable(),
- ServerInstance->Config->ServerName, (unsigned long)x->set_time, (unsigned long)x->duration, x->reason.c_str());
+ ServerInstance->Config->ServerName.c_str(), (unsigned long)x->set_time, (unsigned long)x->duration, x->reason.c_str());
parameterlist params;
params.push_back(data);
diff --git a/src/modules/m_spanningtree/opertype.cpp b/src/modules/m_spanningtree/opertype.cpp
index 38b621fb5..dc9c0064f 100644
--- a/src/modules/m_spanningtree/opertype.cpp
+++ b/src/modules/m_spanningtree/opertype.cpp
@@ -47,10 +47,7 @@ bool TreeSocket::OperType(const std::string &prefix, parameterlist &params)
* If quiet bursts are enabled, and server is bursting or silent uline (i.e. services),
* then do nothing. -- w00t
*/
- if (
- remoteserver->bursting ||
- ServerInstance->SilentULine(ServerInstance->FindServerNamePtr(u->server))
- )
+ if (remoteserver->bursting || ServerInstance->SilentULine(u->server))
{
dosend = false;
}
diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp
index 147445c0c..7d09d939f 100644
--- a/src/modules/m_spanningtree/override_map.cpp
+++ b/src/modules/m_spanningtree/override_map.cpp
@@ -170,13 +170,13 @@ bool ModuleSpanningTree::HandleMap(const std::vector<std::string>& parameters, U
{
// terminate the string at maxnamew characters
names[100 * t + maxnamew] = '\0';
- ServerInstance->DumpText(user, ":%s %d %s :%s %s", ServerInstance->Config->ServerName,
+ ServerInstance->DumpText(user, ":%s %d %s :%s %s", ServerInstance->Config->ServerName.c_str(),
RPL_MAP, user->nick.c_str(), names + 100 * t, stats + 50 * t);
}
ServerInstance->DumpText(user, ":%s %d %s :%d server%s and %d user%s, average %.2f users per server",
- ServerInstance->Config->ServerName, RPL_MAPUSERS, user->nick.c_str(),
+ ServerInstance->Config->ServerName.c_str(), RPL_MAPUSERS, user->nick.c_str(),
line, (line > 1 ? "s" : ""), totusers, (totusers > 1 ? "s" : ""), avg_users);
- ServerInstance->DumpText(user, ":%s %d %s :End of /MAP", ServerInstance->Config->ServerName,
+ ServerInstance->DumpText(user, ":%s %d %s :End of /MAP", ServerInstance->Config->ServerName.c_str(),
RPL_ENDMAP, user->nick.c_str());
delete[] names;
diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp
index 96ca2236d..6279564df 100644
--- a/src/modules/m_spanningtree/uid.cpp
+++ b/src/modules/m_spanningtree/uid.cpp
@@ -99,7 +99,7 @@ bool TreeSocket::ParseUID(const std::string &source, parameterlist &params)
_new->nick.assign(params[2], 0, MAXBUF);
_new->host.assign(params[3], 0, 64);
_new->dhost.assign(params[4], 0, 64);
- _new->server = ServerInstance->FindServerNamePtr(remoteserver->GetName().c_str());
+ _new->server = remoteserver->GetName();
_new->ident.assign(params[5], 0, MAXBUF);
_new->fullname.assign(params[params.size() - 1], 0, MAXBUF);
_new->registered = REG_ALL;