summaryrefslogtreecommitdiff
path: root/src/gui/whoisonline.cpp
diff options
context:
space:
mode:
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());
}