diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2024-01-23 13:31:27 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-23 13:31:27 -0500 |
| commit | ba518f68994783f00d0dd1c1936b1a20465f6186 (patch) | |
| tree | 7c2daff138094add6ca580d15e67bb9f9745b0fc /src/core/hle/service/vi/vi.cpp | |
| parent | 8649a800715a51e04301ec4680e3f5d341aa6d59 (diff) | |
| parent | fc5d76e6e2f92795537ac44b69da19ec4c48250d (diff) | |
Merge pull request #12768 from german77/wrong_conversion
service: properly convert buffers to strings
Diffstat (limited to 'src/core/hle/service/vi/vi.cpp')
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
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 @@ #include "common/logging/log.h" #include "common/math_util.h" #include "common/settings.h" +#include "common/string_util.h" #include "common/swap.h" #include "core/core_timing.h" #include "core/hle/kernel/k_readable_event.h" @@ -694,9 +695,7 @@ private: void OpenLayer(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto name_buf = rp.PopRaw<std::array<u8, 0x40>>(); - const auto end = std::find(name_buf.begin(), name_buf.end(), '\0'); - - const std::string display_name(name_buf.begin(), end); + const std::string display_name(Common::StringFromBuffer(name_buf)); const u64 layer_id = rp.Pop<u64>(); const u64 aruid = rp.Pop<u64>(); |
