diff options
author | Adam <Adam@anope.org> | 2012-10-01 04:35:36 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-10-01 04:35:36 -0400 |
commit | f14a3dfb8a4cc9da7b5066ac8320265d54dba177 (patch) | |
tree | e024da12840263dc3295fea16c786000d33b66ef | |
parent | b19a3af4db6fefdf3d94963163eb00e7133c8046 (diff) |
Fix a few problems found by Cronusa and KindOne
-rw-r--r-- | src/protocol.cpp | 4 | ||||
-rw-r--r-- | src/servers.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp index c6ace2a16..14fe249ed 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -326,11 +326,11 @@ MessageSource::MessageSource(const Anope::string &src) : source(src), u(NULL), s this->u = finduser(src); } -MessageSource::MessageSource(User *_u) : source(_u->nick), u(_u), s(NULL) +MessageSource::MessageSource(User *_u) : source(_u ? _u->nick : ""), u(_u), s(NULL) { } -MessageSource::MessageSource(Server *_s) : source(_s->GetName()), u(NULL), s(_s) +MessageSource::MessageSource(Server *_s) : source(_s ? _s->GetName() : ""), u(NULL), s(_s) { } diff --git a/src/servers.cpp b/src/servers.cpp index d89757996..40d4bc2b2 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -212,7 +212,7 @@ void Server::SetSID(const Anope::string &sid) */ const Anope::string &Server::GetSID() const { - if (!this->SID.empty()) + if (!this->SID.empty() && ircdproto->RequiresID) return this->SID; else return this->Name; diff --git a/src/users.cpp b/src/users.cpp index a992d8d04..a68c03739 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -178,7 +178,7 @@ const Anope::string &User::GetCloakedHost() const const Anope::string &User::GetUID() const { - if (!this->uid.empty()) + if (!this->uid.empty() && ircdproto->RequiresID) return this->uid; else return this->nick; |