summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-07-19 23:04:25 -0400
committerGravatar Lioncash2018-07-19 23:15:00 -0400
commitc20cea118b2f045cd1b057aac766ac8c0c64eb6c (patch)
tree3783288f8e8ab77fb7d9060d60065e27ed091a8f /src
parentMerge pull request #726 from lioncash/overload (diff)
downloadyuzu-c20cea118b2f045cd1b057aac766ac8c0c64eb6c.tar.gz
yuzu-c20cea118b2f045cd1b057aac766ac8c0c64eb6c.tar.xz
yuzu-c20cea118b2f045cd1b057aac766ac8c0c64eb6c.zip
audout_u: Use a std::array instead of std::string for holding the audio interface name
Uses a type that doesn't potentially dynamically allocate, and ensures that the name of the interface is properly null-terminated when writing it to the buffer.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/audio/audout_u.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index 4217ea4fb..154bc12da 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -2,6 +2,7 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <array>
5#include <vector> 6#include <vector>
6#include "common/logging/log.h" 7#include "common/logging/log.h"
7#include "core/core_timing.h" 8#include "core/core_timing.h"
@@ -167,7 +168,7 @@ void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) {
167 LOG_WARNING(Service_Audio, "(STUBBED) called"); 168 LOG_WARNING(Service_Audio, "(STUBBED) called");
168 IPC::RequestParser rp{ctx}; 169 IPC::RequestParser rp{ctx};
169 170
170 const std::string audio_interface = "AudioInterface"; 171 constexpr std::array<char, 15> audio_interface{{"AudioInterface"}};
171 ctx.WriteBuffer(audio_interface); 172 ctx.WriteBuffer(audio_interface);
172 173
173 IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0); 174 IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0);