mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-04 14:02:45 +01:00
Merge pull request #6793 from Morph1984/lang-fix
service: set: Correct copy amount in GetAvailableLanguageCodes
This commit is contained in:
commit
d20bcb7faf
1 changed files with 2 additions and 1 deletions
|
@ -85,7 +85,8 @@ void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t num_la
|
||||||
|
|
||||||
void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t max_entries) {
|
void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t max_entries) {
|
||||||
const std::size_t requested_amount = ctx.GetWriteBufferSize() / sizeof(LanguageCode);
|
const std::size_t requested_amount = ctx.GetWriteBufferSize() / sizeof(LanguageCode);
|
||||||
const std::size_t copy_amount = std::min(requested_amount, max_entries);
|
const std::size_t max_amount = std::min(requested_amount, max_entries);
|
||||||
|
const std::size_t copy_amount = std::min(available_language_codes.size(), max_amount);
|
||||||
const std::size_t copy_size = copy_amount * sizeof(LanguageCode);
|
const std::size_t copy_size = copy_amount * sizeof(LanguageCode);
|
||||||
|
|
||||||
ctx.WriteBuffer(available_language_codes.data(), copy_size);
|
ctx.WriteBuffer(available_language_codes.data(), copy_size);
|
||||||
|
|
Loading…
Reference in a new issue