diff options
author | bunnei <bunneidev@gmail.com> | 2023-06-22 06:05:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-22 06:05:03 +0200 |
commit | 8ad64bc2530f38a605f7af94a5d153c054614d34 (patch) | |
tree | 92d3e29eedfb968e2c5bf4dc50986225e2b14247 /src/core/hle | |
parent | Merge pull request #10864 from t895/disable-mali-driver (diff) | |
parent | time_zone_manager: Add null terminator (diff) | |
download | yuzu-8ad64bc2530f38a605f7af94a5d153c054614d34.tar yuzu-8ad64bc2530f38a605f7af94a5d153c054614d34.tar.gz yuzu-8ad64bc2530f38a605f7af94a5d153c054614d34.tar.bz2 yuzu-8ad64bc2530f38a605f7af94a5d153c054614d34.tar.lz yuzu-8ad64bc2530f38a605f7af94a5d153c054614d34.tar.xz yuzu-8ad64bc2530f38a605f7af94a5d153c054614d34.tar.zst yuzu-8ad64bc2530f38a605f7af94a5d153c054614d34.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/time/time_zone_manager.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index 63aacd19f..205371a26 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp @@ -911,9 +911,13 @@ static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, calendar_additional_info.is_dst = rules.ttis[tti_index].is_dst; 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] = '\0'; return ResultSuccess; } |