diff options
author | Spp- <u84280@epreinf21.(none)> | 2011-07-29 14:18:28 +0200 |
---|---|---|
committer | Spp- <u84280@epreinf21.(none)> | 2011-07-29 14:18:28 +0200 |
commit | e47b96af3e3a41eae71e3e3da7eeee8bd3de86bc (patch) | |
tree | 07d5ff1e6e39d792dbe1a89cc373c06702817787 /src/server/shared/Utilities/Util.cpp | |
parent | 06b46ba203d30cc5e2abc9741b2fc737ebdd7c38 (diff) |
Core: Append single character to stream as character, not as a string
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) { |