summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar lat9nq2023-06-17 20:53:39 -0400
committerGravatar lat9nq2023-06-17 20:53:39 -0400
commitb99c4dd568fa12a833eeae25caeb9c0b1887465b (patch)
treecbbcbcfd2d83e596725a84036a8aee570f5d45a8
parentnx_tzdb: Directly reference variables in if statements (diff)
downloadyuzu-b99c4dd568fa12a833eeae25caeb9c0b1887465b.tar.gz
yuzu-b99c4dd568fa12a833eeae25caeb9c0b1887465b.tar.xz
yuzu-b99c4dd568fa12a833eeae25caeb9c0b1887465b.zip
time_zone_service: Always write time zone rule data
Switch firmware will initialize this data even if the given parameters are invalid. We should do the same.
-rw-r--r--src/core/hle/service/time/time_zone_service.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/hle/service/time/time_zone_service.cpp b/src/core/hle/service/time/time_zone_service.cpp
index e8273e152..8171c82a5 100644
--- a/src/core/hle/service/time/time_zone_service.cpp
+++ b/src/core/hle/service/time/time_zone_service.cpp
@@ -112,20 +112,14 @@ void ITimeZoneService::LoadTimeZoneRule(HLERequestContext& ctx) {
112 LOG_DEBUG(Service_Time, "called, location_name={}", location_name); 112 LOG_DEBUG(Service_Time, "called, location_name={}", location_name);
113 113
114 TimeZone::TimeZoneRule time_zone_rule{}; 114 TimeZone::TimeZoneRule time_zone_rule{};
115 if (const Result result{ 115 const Result result{time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)};
116 time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)};
117 result != ResultSuccess) {
118 IPC::ResponseBuilder rb{ctx, 2};
119 rb.Push(result);
120 return;
121 }
122 116
123 std::vector<u8> time_zone_rule_outbuffer(sizeof(TimeZone::TimeZoneRule)); 117 std::vector<u8> time_zone_rule_outbuffer(sizeof(TimeZone::TimeZoneRule));
124 std::memcpy(time_zone_rule_outbuffer.data(), &time_zone_rule, sizeof(TimeZone::TimeZoneRule)); 118 std::memcpy(time_zone_rule_outbuffer.data(), &time_zone_rule, sizeof(TimeZone::TimeZoneRule));
125 ctx.WriteBuffer(time_zone_rule_outbuffer); 119 ctx.WriteBuffer(time_zone_rule_outbuffer);
126 120
127 IPC::ResponseBuilder rb{ctx, 2}; 121 IPC::ResponseBuilder rb{ctx, 2};
128 rb.Push(ResultSuccess); 122 rb.Push(result);
129} 123}
130 124
131void ITimeZoneService::ToCalendarTime(HLERequestContext& ctx) { 125void ITimeZoneService::ToCalendarTime(HLERequestContext& ctx) {