VERY experimental Nintendo Switch 2 emulator
C++
[time] fix: guard timezone out buffer logging (#3668)
crueterc7b23f4a1aec
diff --git a/src/core/hle/service/glue/time/time_zone.cpp b/src/core/hle/service/glue/time/time_zone.cppindex b2e8159653..c358cfbf28 100644--- a/src/core/hle/service/glue/time/time_zone.cpp+++ b/src/core/hle/service/glue/time/time_zone.cpp@@ -1,3 +1,6 @@+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project+// SPDX-License-Identifier: GPL-3.0-or-later+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project// SPDX-License-Identifier: GPL-2.0-or-later@@ -104,7 +107,8 @@ Result TimeZoneService::LoadLocationNameList(OutArray<Service::PSC::Time::LocationName, BufferAttr_HipcMapAlias> out_names, u32 index) {SCOPE_EXIT {LOG_DEBUG(Service_Time, "called. index={} out_count={} out_names[0]={} out_names[1]={}",- index, *out_count, out_names[0], out_names[1]);+ index, *out_count, out_names.size() > 0 ? out_names[0] : Service::PSC::Time::LocationName{},+ out_names.size() > 1 ? out_names[1] : Service::PSC::Time::LocationName{});};std::scoped_lock l{m_mutex};@@ -208,7 +212,8 @@ Result TimeZoneService::ToPosixTime(Out<u32> out_count,SCOPE_EXIT {LOG_DEBUG(Service_Time,"called. calendar_time={} out_count={} out_times[0]={} out_times[1]={}",- calendar_time, *out_count, out_times[0], out_times[1]);+ calendar_time, *out_count, out_times.size() > 0 ? out_times[0] : s64{0},+ out_times.size() > 1 ? out_times[1] : s64{0});};R_RETURN(m_wrapped_service->ToPosixTime(out_count, out_times, calendar_time, rule));@@ -220,7 +225,8 @@ Result TimeZoneService::ToPosixTimeWithMyRule(SCOPE_EXIT {LOG_DEBUG(Service_Time,"called. calendar_time={} out_count={} out_times[0]={} out_times[1]={}",- calendar_time, *out_count, out_times[0], out_times[1]);+ calendar_time, *out_count, out_times.size() > 0 ? out_times[0] : s64{0},+ out_times.size() > 1 ? out_times[1] : s64{0});};R_RETURN(m_wrapped_service->ToPosixTimeWithMyRule(out_count, out_times, calendar_time));diff --git a/src/core/hle/service/psc/time/time_zone_service.cpp b/src/core/hle/service/psc/time/time_zone_service.cppindex 9e0674f275..d49c0056ec 100644--- a/src/core/hle/service/psc/time/time_zone_service.cpp+++ b/src/core/hle/service/psc/time/time_zone_service.cpp@@ -1,3 +1,6 @@+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project+// SPDX-License-Identifier: GPL-3.0-or-later+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project// SPDX-License-Identifier: GPL-2.0-or-later@@ -148,7 +151,8 @@ Result TimeZoneService::ToPosixTime(Out<u32> out_count,SCOPE_EXIT {LOG_DEBUG(Service_Time,"called. calendar_time={} out_count={} out_times[0]={} out_times[1]={} ",- calendar_time, *out_count, out_times[0], out_times[1]);+ calendar_time, *out_count, out_times.size() > 0 ? out_times[0] : s64{0},+ out_times.size() > 1 ? out_times[1] : s64{0});};R_RETURN(@@ -161,7 +165,8 @@ Result TimeZoneService::ToPosixTimeWithMyRule(Out<u32> out_count,SCOPE_EXIT {LOG_DEBUG(Service_Time,"called. calendar_time={} out_count={} out_times[0]={} out_times[1]={} ",- calendar_time, *out_count, out_times[0], out_times[1]);+ calendar_time, *out_count, out_times.size() > 0 ? out_times[0] : s64{0},+ out_times.size() > 1 ? out_times[1] : s64{0});};R_RETURN(