diff options
| author | 2023-06-20 15:52:17 -0400 | |
|---|---|---|
| committer | 2023-06-20 15:54:28 -0400 | |
| commit | ae1a8a7dc7bbe656d9abac646472df2ccf1660db (patch) | |
| tree | 7e08b8bfed33d9cf183086a86140d81805877a89 /src | |
| parent | time_zone_manager: Stop on comma (diff) | |
| download | yuzu-ae1a8a7dc7bbe656d9abac646472df2ccf1660db.tar.gz yuzu-ae1a8a7dc7bbe656d9abac646472df2ccf1660db.tar.xz yuzu-ae1a8a7dc7bbe656d9abac646472df2ccf1660db.zip | |
time_zone_manager: Add null terminator
We aren't null-terminating this string after the copy, and we need to.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/time/time_zone_manager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index 43d0a19b8..205371a26 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp | |||
| @@ -911,11 +911,13 @@ static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, | |||
| 911 | 911 | ||
| 912 | calendar_additional_info.is_dst = rules.ttis[tti_index].is_dst; | 912 | calendar_additional_info.is_dst = rules.ttis[tti_index].is_dst; |
| 913 | const char* time_zone{&rules.chars[rules.ttis[tti_index].abbreviation_list_index]}; | 913 | const char* time_zone{&rules.chars[rules.ttis[tti_index].abbreviation_list_index]}; |
| 914 | for (u32 index{}; time_zone[index] != '\0' && time_zone[index] != ',' && | 914 | u32 index; |
| 915 | index < calendar_additional_info.timezone_name.size() - 1; | 915 | for (index = 0; time_zone[index] != '\0' && time_zone[index] != ',' && |
| 916 | index < calendar_additional_info.timezone_name.size() - 1; | ||
| 916 | ++index) { | 917 | ++index) { |
| 917 | calendar_additional_info.timezone_name[index] = time_zone[index]; | 918 | calendar_additional_info.timezone_name[index] = time_zone[index]; |
| 918 | } | 919 | } |
| 920 | calendar_additional_info.timezone_name[index] = '\0'; | ||
| 919 | return ResultSuccess; | 921 | return ResultSuccess; |
| 920 | } | 922 | } |
| 921 | 923 | ||