Import of CCTZ from GitHub.

PiperOrigin-RevId: 471600654
Change-Id: Iee722e5d736d341bc81cc10dac290383ba392f87
pull/1269/head
Abseil Team 2 years ago committed by Copybara-Service
parent af0babf01f
commit 30e43220e4
  1. 5
      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<size_t>(max_size));
if (CFStringGetCString(tz_name, &buffer[0], max_size, encoding)) {
zone = &buffer[0];
}
}

Loading…
Cancel
Save