summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd_time.cpp7
-rw-r--r--src/modules/m_spanningtree.cpp9
2 files changed, 14 insertions, 2 deletions
diff --git a/src/cmd_time.cpp b/src/cmd_time.cpp
index 4897110a4..054e469fa 100644
--- a/src/cmd_time.cpp
+++ b/src/cmd_time.cpp
@@ -69,7 +69,12 @@ void cmd_time::Handle (char **parameters, int pcnt, userrec *user)
time(&rawtime);
timeinfo = localtime(&rawtime);
- WriteServ(user->fd,"391 %s %s :%s",user->nick,Config->ServerName,asctime(timeinfo));
+
+ char tms[26];
+ snprintf(tms,26,"%s",asctime(timeinfo));
+ tms[24] = 0;
+
+ WriteServ(user->fd,"391 %s %s :%s",user->nick,Config->ServerName,tms);
}
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 4e45e6dd1..475e75e84 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1727,7 +1727,10 @@ class TreeSocket : public InspSocket
time_t rawtime = atol(params[2].c_str());
struct tm * timeinfo;
timeinfo = localtime(&rawtime);
- WriteServ(u->fd,"391 %s %s :%s",u->nick,prefix.c_str(),asctime(timeinfo));
+ char tms[26];
+ snprintf(tms,26,"%s",asctime(timeinfo));
+ tms[24] = 0;
+ WriteServ(u->fd,"391 %s %s :%s",u->nick,prefix.c_str(),tms);
}
else
{
@@ -2808,6 +2811,10 @@ class ModuleSpanningTree : public Module
TreeServer* found = FindServerMask(parameters[0]);
if (found)
{
+ // we dont' override for local server
+ if (found == TreeRoot)
+ return 0;
+
std::deque<std::string> params;
params.push_back(found->GetName());
params.push_back(user->nick);