diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-03-02 21:17:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-02 21:17:13 +0300 |
commit | 181ecd0c3bf27b47487f973fb83b988fd6ceaecf (patch) | |
tree | 4ee3de6acd80bf81d0960ac49d64f718f5019102 /src/gui/whoisonline.cpp | |
parent | fb1709d774139b2173da6ee95770abaad23f726e (diff) | |
download | mv-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.tar.gz mv-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.tar.bz2 mv-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.tar.xz mv-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.zip |
Another fixes after Coverity checks.
Diffstat (limited to 'src/gui/whoisonline.cpp')
-rw-r--r-- | src/gui/whoisonline.cpp | 15 |
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()); } |