From 30e43220e420880eba82238cd6c44a081bb4826d Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 1 Sep 2022 12:18:47 -0700 Subject: Import of CCTZ from GitHub. PiperOrigin-RevId: 471600654 Change-Id: Iee722e5d736d341bc81cc10dac290383ba392f87 --- absl/time/internal/cctz/src/time_zone_lookup.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'absl/time') diff --git a/absl/time/internal/cctz/src/time_zone_lookup.cc b/absl/time/internal/cctz/src/time_zone_lookup.cc index 84aa037a..f6983aeb 100644 --- a/absl/time/internal/cctz/src/time_zone_lookup.cc +++ b/absl/time/internal/cctz/src/time_zone_lookup.cc @@ -140,8 +140,9 @@ time_zone local_time_zone() { if (CFStringRef tz_name = CFTimeZoneGetName(tz_default)) { CFStringEncoding encoding = kCFStringEncodingUTF8; CFIndex length = CFStringGetLength(tz_name); - buffer.resize(CFStringGetMaximumSizeForEncoding(length, encoding) + 1); - if (CFStringGetCString(tz_name, &buffer[0], buffer.size(), encoding)) { + CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, encoding) + 1; + buffer.resize(static_cast(max_size)); + if (CFStringGetCString(tz_name, &buffer[0], max_size, encoding)) { zone = &buffer[0]; } } -- cgit v1.2.3