From 181ecd0c3bf27b47487f973fb83b988fd6ceaecf Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Mar 2013 21:17:13 +0300 Subject: Another fixes after Coverity checks. --- src/gui/whoisonline.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/gui/whoisonline.cpp') 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()); } -- cgit v1.2.3-60-g2f50