summaryrefslogtreecommitdiff
path: root/absl/time
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-06-05 03:36:06 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-06-05 03:36:58 -0700
commit7a74153a05aa8bacb8cb9ae3fa707e5407adc2c9 (patch)
treeba0755bd065da8f1bbbd4288aa3c2e500eaa20a6 /absl/time
parent77ba7ca9d2a523ef9f1837e53554fa65c232abc8 (diff)
Import of CCTZ from GitHub.
PiperOrigin-RevId: 537825067 Change-Id: I3ce8712d5130068fb7d77b563eb502e2e9560810
Diffstat (limited to 'absl/time')
-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);
}