summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-21 22:09:55 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-21 22:09:55 +0300
commit2ee0ae2b8c21d5b1c2a77e06edf6a9883086a1ba (patch)
treece20fefa29fbb6e5ab50ccef15c1d56fd58e9f24 /src/utils/stringutils.cpp
parente8cb5cdebbd47cf2223f837627fbb27c8dc51515 (diff)
downloadmv-2ee0ae2b8c21d5b1c2a77e06edf6a9883086a1ba.tar.gz
mv-2ee0ae2b8c21d5b1c2a77e06edf6a9883086a1ba.tar.bz2
mv-2ee0ae2b8c21d5b1c2a77e06edf6a9883086a1ba.tar.xz
mv-2ee0ae2b8c21d5b1c2a77e06edf6a9883086a1ba.zip
Fix chat commands /store and /retreive without amount.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 4aa8f5619..8af8ea547 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -765,7 +765,7 @@ uint32_t parseNumber(const std::string &str)
std::string removeToken(std::string &str, const std::string &token)
{
const size_t idx = str.find(token);
- if (idx > 0)
+ if (idx > 0 && idx != std::string::npos)
str = str.substr(idx + 1);
else
str.clear();