summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--absl/time/internal/cctz/src/time_zone_lookup.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/absl/time/internal/cctz/src/time_zone_lookup.cc b/absl/time/internal/cctz/src/time_zone_lookup.cc
index 68084ce2..9a30ba5e 100644
--- a/absl/time/internal/cctz/src/time_zone_lookup.cc
+++ b/absl/time/internal/cctz/src/time_zone_lookup.cc
@@ -148,11 +148,12 @@ std::string win32_local_time_zone(const HMODULE combase) {
UINT32 wlen;
const PCWSTR tz_wstr = windows_get_string_raw_buffer(tz_hstr, &wlen);
if (tz_wstr) {
- const int size = WideCharToMultiByte(CP_UTF8, 0, tz_wstr, wlen, nullptr,
- 0, nullptr, nullptr);
- result.resize(size);
- WideCharToMultiByte(CP_UTF8, 0, tz_wstr, wlen, &result[0], size, nullptr,
- nullptr);
+ const int size =
+ WideCharToMultiByte(CP_UTF8, 0, tz_wstr, static_cast<int>(wlen),
+ nullptr, 0, nullptr, nullptr);
+ result.resize(static_cast<size_t>(size));
+ WideCharToMultiByte(CP_UTF8, 0, tz_wstr, static_cast<int>(wlen),
+ &result[0], size, nullptr, nullptr);
}
windows_delete_string(tz_hstr);
}