diff options
Diffstat (limited to 'src/server/shared/Utilities/Util.cpp')
-rwxr-xr-x | src/server/shared/Utilities/Util.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index 3cea21f7928..47e18943f75 100755 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -182,7 +182,7 @@ uint32 TimeStringToSecs(const std::string& timestring) uint32 buffer = 0; uint32 multiplier = 0; - for (std::string::const_iterator itr = timestring.begin(); itr != timestring.end(); itr++ ) + for (std::string::const_iterator itr = timestring.begin(); itr != timestring.end(); ++itr) { if(isdigit(*itr)) { @@ -318,11 +318,11 @@ bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr) { try { - size_t len = utf8::distance(utf8str.c_str(), utf8str.c_str()+utf8str.size()); - wstr.resize(len); - - if (len) + if (size_t len = utf8::distance(utf8str.c_str(), utf8str.c_str()+utf8str.size())) + { + wstr.resize(len); utf8::utf8to16(utf8str.c_str(), utf8str.c_str()+utf8str.size(), &wstr[0]); + } } catch(std::exception) { |