summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-06-22 06:05:03 +0200
committerGitHub <noreply@github.com>2023-06-22 06:05:03 +0200
commit8ad64bc2530f38a605f7af94a5d153c054614d34 (patch)
tree92d3e29eedfb968e2c5bf4dc50986225e2b14247
parentMerge pull request #10864 from t895/disable-mali-driver (diff)
parenttime_zone_manager: Add null terminator (diff)
downloadyuzu-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.cpp6
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;
}