summaryrefslogtreecommitdiff
path: root/src/gui/whoisonline.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-02 21:17:13 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-02 21:17:13 +0300
commit181ecd0c3bf27b47487f973fb83b988fd6ceaecf (patch)
tree4ee3de6acd80bf81d0960ac49d64f718f5019102 /src/gui/whoisonline.cpp
parentfb1709d774139b2173da6ee95770abaad23f726e (diff)
downloadplus-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.tar.gz
plus-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.tar.bz2
plus-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.tar.xz
plus-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.zip
Another fixes after Coverity checks.
Diffstat (limited to 'src/gui/whoisonline.cpp')
-rw-r--r--src/gui/whoisonline.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index a1058928d..84f0fd2f5 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -713,15 +713,16 @@ void WhoIsOnline::updateSize()
const std::string WhoIsOnline::prepareNick(std::string nick, int level,
std::string color) const
{
- const char *const text = encodeLinkText(nick).c_str();
+ const std::string text = encodeLinkText(nick);
if (mShowLevel && level > 1)
{
- return strprintf("@@%s|##%s%s (%d)@@", text,
- color.c_str(), text, level);
+ return strprintf("@@%s|##%s%s (%d)@@", text.c_str(),
+ color.c_str(), text.c_str(), level);
}
else
{
- return strprintf("@@%s|##%s%s@@", text, color.c_str(), text);
+ return strprintf("@@%s|##%s%s@@", text.c_str(),
+ color.c_str(), text.c_str());
}
}
@@ -846,7 +847,7 @@ void OnlinePlayer::setText(std::string color)
if (mVersion > 0)
mText.append(strprintf(" - %d", mVersion));
- const char *const text = encodeLinkText(mNick).c_str();
- mText = strprintf("@@%s|##%s%s %s@@", text, color.c_str(),
- text, mText.c_str());
+ const std::string text = encodeLinkText(mNick);
+ mText = strprintf("@@%s|##%s%s %s@@", text.c_str(), color.c_str(),
+ text.c_str(), mText.c_str());
}