Merge pull request #10863 from lat9nq/tz-end-of-string

time_zone_manager: Stop on comma
This commit is contained in:
bunnei 2023-06-21 21:05:03 -07:00 committed by GitHub
commit 8ad64bc253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -911,9 +911,13 @@ static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time,
calendar_additional_info.is_dst = rules.ttis[tti_index].is_dst; calendar_additional_info.is_dst = rules.ttis[tti_index].is_dst;
const char* time_zone{&rules.chars[rules.ttis[tti_index].abbreviation_list_index]}; const char* time_zone{&rules.chars[rules.ttis[tti_index].abbreviation_list_index]};
for (int index{}; time_zone[index] != '\0'; ++index) { u32 index;
for (index = 0; time_zone[index] != '\0' && time_zone[index] != ',' &&
index < calendar_additional_info.timezone_name.size() - 1;
++index) {
calendar_additional_info.timezone_name[index] = time_zone[index]; calendar_additional_info.timezone_name[index] = time_zone[index];
} }
calendar_additional_info.timezone_name[index] = '\0';
return ResultSuccess; return ResultSuccess;
} }