mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-14 20:12:56 +00:00
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.
This commit is contained in:
parent
d3cfaf95c8
commit
c20cea118b
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <array>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
|
@ -167,7 +168,7 @@ void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) {
|
||||||
LOG_WARNING(Service_Audio, "(STUBBED) called");
|
LOG_WARNING(Service_Audio, "(STUBBED) called");
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
|
|
||||||
const std::string audio_interface = "AudioInterface";
|
constexpr std::array<char, 15> audio_interface{{"AudioInterface"}};
|
||||||
ctx.WriteBuffer(audio_interface);
|
ctx.WriteBuffer(audio_interface);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0);
|
IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0);
|
||||||
|
|
Loading…
Reference in a new issue