diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-11 17:35:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-11 18:00:22 +0300 |
commit | 52c7195a8ee91f95ef134d9798a47ea313df16c8 (patch) | |
tree | ca1f32cfadce611a1820b50f5386c02cd2ce06ae /src/spellmanager.cpp | |
parent | f1b82c1b06604c2c1eed750a6c980aa0b5355560 (diff) | |
download | manaplus-52c7195a8ee91f95ef134d9798a47ea313df16c8.tar.gz manaplus-52c7195a8ee91f95ef134d9798a47ea313df16c8.tar.bz2 manaplus-52c7195a8ee91f95ef134d9798a47ea313df16c8.tar.xz manaplus-52c7195a8ee91f95ef134d9798a47ea313df16c8.zip |
Second part of checks from Parasoft C++ Test.
Diffstat (limited to 'src/spellmanager.cpp')
-rw-r--r-- | src/spellmanager.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index c8f6fd836..5d465e244 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -203,20 +203,20 @@ std::string SpellManager::parseCommand(std::string command, bool found = false; - int idx = static_cast<int>(command.find("<TARGET>")); - if (idx >= 0) + size_t idx = command.find("<TARGET>"); + if (idx != std::string::npos) { found = true; command = replaceAll(command, "<TARGET>", name); } - idx = static_cast<int>(command.find("<TARGETID>")); - if (idx >= 0) + idx = command.find("<TARGETID>"); + if (idx != std::string::npos) { found = true; command = replaceAll(command, "<TARGETID>", id); } - idx = static_cast<int>(command.find("<TARGETORSELF>")); - if (idx >= 0) + idx = command.find("<TARGETORSELF>"); + if (idx != std::string::npos) { found = true; command = replaceAll(command, "<TARGETORSELF>", name2); |