summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Narr the Reg2024-01-23 10:24:05 -0600
committerGravatar Narr the Reg2024-01-23 10:24:05 -0600
commitfc5d76e6e2f92795537ac44b69da19ec4c48250d (patch)
tree560135737473d575a2f415d8490b4981ebff4a3b /src
parentMerge pull request #12579 from FernandoS27/smmu (diff)
downloadyuzu-fc5d76e6e2f92795537ac44b69da19ec4c48250d.tar.gz
yuzu-fc5d76e6e2f92795537ac44b69da19ec4c48250d.tar.xz
yuzu-fc5d76e6e2f92795537ac44b69da19ec4c48250d.zip
service: properly convert buffers to strings
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/nvdrv/nvdrv_interface.cpp3
-rw-r--r--src/core/hle/service/set/system_settings_server.cpp8
-rw-r--r--src/core/hle/service/vi/vi.cpp5
3 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp
index 6e4825313..ffe72f281 100644
--- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp
+++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp
@@ -4,6 +4,7 @@
4 4
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "common/scope_exit.h" 6#include "common/scope_exit.h"
7#include "common/string_util.h"
7#include "core/core.h" 8#include "core/core.h"
8#include "core/hle/kernel/k_event.h" 9#include "core/hle/kernel/k_event.h"
9#include "core/hle/kernel/k_process.h" 10#include "core/hle/kernel/k_process.h"
@@ -29,7 +30,7 @@ void NVDRV::Open(HLERequestContext& ctx) {
29 } 30 }
30 31
31 const auto& buffer = ctx.ReadBuffer(); 32 const auto& buffer = ctx.ReadBuffer();
32 const std::string device_name(buffer.begin(), buffer.end()); 33 const std::string device_name(Common::StringFromBuffer(buffer));
33 34
34 if (device_name == "/dev/nvhost-prof-gpu") { 35 if (device_name == "/dev/nvhost-prof-gpu") {
35 rb.Push<DeviceFD>(0); 36 rb.Push<DeviceFD>(0);
diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp
index 2e5785fed..429e96d11 100644
--- a/src/core/hle/service/set/system_settings_server.cpp
+++ b/src/core/hle/service/set/system_settings_server.cpp
@@ -710,12 +710,12 @@ void ISystemSettingsServer::GetSettingsItemValueSize(HLERequestContext& ctx) {
710 // The category of the setting. This corresponds to the top-level keys of 710 // The category of the setting. This corresponds to the top-level keys of
711 // system_settings.ini. 711 // system_settings.ini.
712 const auto setting_category_buf{ctx.ReadBuffer(0)}; 712 const auto setting_category_buf{ctx.ReadBuffer(0)};
713 const std::string setting_category{setting_category_buf.begin(), setting_category_buf.end()}; 713 const std::string setting_category{Common::StringFromBuffer(setting_category_buf)};
714 714
715 // The name of the setting. This corresponds to the second-level keys of 715 // The name of the setting. This corresponds to the second-level keys of
716 // system_settings.ini. 716 // system_settings.ini.
717 const auto setting_name_buf{ctx.ReadBuffer(1)}; 717 const auto setting_name_buf{ctx.ReadBuffer(1)};
718 const std::string setting_name{setting_name_buf.begin(), setting_name_buf.end()}; 718 const std::string setting_name{Common::StringFromBuffer(setting_name_buf)};
719 719
720 auto settings{GetSettings()}; 720 auto settings{GetSettings()};
721 u64 response_size{0}; 721 u64 response_size{0};
@@ -733,12 +733,12 @@ void ISystemSettingsServer::GetSettingsItemValue(HLERequestContext& ctx) {
733 // The category of the setting. This corresponds to the top-level keys of 733 // The category of the setting. This corresponds to the top-level keys of
734 // system_settings.ini. 734 // system_settings.ini.
735 const auto setting_category_buf{ctx.ReadBuffer(0)}; 735 const auto setting_category_buf{ctx.ReadBuffer(0)};
736 const std::string setting_category{setting_category_buf.begin(), setting_category_buf.end()}; 736 const std::string setting_category{Common::StringFromBuffer(setting_category_buf)};
737 737
738 // The name of the setting. This corresponds to the second-level keys of 738 // The name of the setting. This corresponds to the second-level keys of
739 // system_settings.ini. 739 // system_settings.ini.
740 const auto setting_name_buf{ctx.ReadBuffer(1)}; 740 const auto setting_name_buf{ctx.ReadBuffer(1)};
741 const std::string setting_name{setting_name_buf.begin(), setting_name_buf.end()}; 741 const std::string setting_name{Common::StringFromBuffer(setting_name_buf)};
742 742
743 std::vector<u8> value; 743 std::vector<u8> value;
744 auto response = GetSettingsItemValue(value, setting_category, setting_name); 744 auto response = GetSettingsItemValue(value, setting_category, setting_name);
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index bfcc27ddc..1f3d82c57 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -15,6 +15,7 @@
15#include "common/logging/log.h" 15#include "common/logging/log.h"
16#include "common/math_util.h" 16#include "common/math_util.h"
17#include "common/settings.h" 17#include "common/settings.h"
18#include "common/string_util.h"
18#include "common/swap.h" 19#include "common/swap.h"
19#include "core/core_timing.h" 20#include "core/core_timing.h"
20#include "core/hle/kernel/k_readable_event.h" 21#include "core/hle/kernel/k_readable_event.h"
@@ -694,9 +695,7 @@ private:
694 void OpenLayer(HLERequestContext& ctx) { 695 void OpenLayer(HLERequestContext& ctx) {
695 IPC::RequestParser rp{ctx}; 696 IPC::RequestParser rp{ctx};
696 const auto name_buf = rp.PopRaw<std::array<u8, 0x40>>(); 697 const auto name_buf = rp.PopRaw<std::array<u8, 0x40>>();
697 const auto end = std::find(name_buf.begin(), name_buf.end(), '\0'); 698 const std::string display_name(Common::StringFromBuffer(name_buf));
698
699 const std::string display_name(name_buf.begin(), end);
700 699
701 const u64 layer_id = rp.Pop<u64>(); 700 const u64 layer_id = rp.Pop<u64>();
702 const u64 aruid = rp.Pop<u64>(); 701 const u64 aruid = rp.Pop<u64>();