aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Chat/Channels
diff options
context:
space:
mode:
authorAscathor <Break_the_Chain@web.de>2013-09-15 04:25:19 +0200
committerAscathor <Break_the_Chain@web.de>2013-09-15 13:17:37 +0200
commit4782cc46509c91ff8ee66b4bcbc421e42cf8c65c (patch)
treed3095816fc97867a0e7a911f5a480604417b3bd7 /src/server/game/Chat/Channels
parent9c7de29e9340c7273f9aeb05a3f697e042f0530b (diff)
Core/Misc: Fixed some more issues found by static code analysis tools.
Diffstat (limited to 'src/server/game/Chat/Channels')
-rw-r--r--src/server/game/Chat/Channels/ChannelMgr.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp
index 62b3416f72e..96d28035b29 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/server/game/Chat/Channels/ChannelMgr.cpp
@@ -43,7 +43,9 @@ ChannelMgr* ChannelMgr::forTeam(uint32 team)
Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId)
{
std::wstring wname;
- Utf8toWStr(name, wname);
+ if (!Utf8toWStr(name, wname))
+ return NULL;
+
wstrToLower(wname);
ChannelMap::const_iterator i = channels.find(wname);
@@ -61,7 +63,9 @@ Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId)
Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pkt)
{
std::wstring wname;
- Utf8toWStr(name, wname);
+ if (!Utf8toWStr(name, wname))
+ return NULL;
+
wstrToLower(wname);
ChannelMap::const_iterator i = channels.find(wname);
@@ -84,7 +88,9 @@ Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pk
void ChannelMgr::LeftChannel(std::string const& name)
{
std::wstring wname;
- Utf8toWStr(name, wname);
+ if (!Utf8toWStr(name, wname))
+ return;
+
wstrToLower(wname);
ChannelMap::const_iterator i = channels.find(wname);