diff options
| author | Tannin <sherb@gmx.net> | 2016-05-07 00:03:38 +0200 |
|---|---|---|
| committer | Tannin <sherb@gmx.net> | 2016-05-07 00:03:38 +0200 |
| commit | eb97c46ed68a965d6ddf44fa6741fa929fd7d278 (patch) | |
| tree | f2c92e8a688faacdbd6285ac5b5bf5f91a5ee3e9 /src/shared | |
| parent | d958e11e2b3cde75f481bdb734be10b4e1dda585 (diff) | |
cleanup
Diffstat (limited to 'src/shared')
| -rw-r--r-- | src/shared/util.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/shared/util.cpp b/src/shared/util.cpp index 3692aae1..5491a9e6 100644 --- a/src/shared/util.cpp +++ b/src/shared/util.cpp @@ -81,12 +81,16 @@ std::wstring ToWString(const std::string &source, bool utf8) if (!utf8) {
codepage = AreFileApisANSI() ? GetACP() : GetOEMCP();
}
- int sizeRequired = ::MultiByteToWideChar(codepage, 0, source.c_str(), source.length(), nullptr, 0);
+ int sizeRequired
+ = ::MultiByteToWideChar(codepage, 0, source.c_str(),
+ static_cast<int>(source.length()), nullptr, 0);
if (sizeRequired == 0) {
throw windows_error("failed to convert string to wide character");
}
result.resize(sizeRequired, L'\0');
- ::MultiByteToWideChar(codepage, 0, source.c_str(), source.length(), &result[0], sizeRequired);
+ ::MultiByteToWideChar(codepage, 0, source.c_str(),
+ static_cast<int>(source.length()), &result[0],
+ sizeRequired);
}
return result;
|
