mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-29 02:22:37 -06:00
do not init and copy to ctr_dest_addr unless have data
This commit is contained in:
parent
3b736a72a5
commit
e8bb79be2d
1 changed files with 2 additions and 3 deletions
|
@ -544,11 +544,10 @@ void SOC_U::SendTo(Kernel::HLERequestContext& ctx) {
|
||||||
auto input_buff = rp.PopStaticBuffer();
|
auto input_buff = rp.PopStaticBuffer();
|
||||||
auto dest_addr_buff = rp.PopStaticBuffer();
|
auto dest_addr_buff = rp.PopStaticBuffer();
|
||||||
|
|
||||||
CTRSockAddr ctr_dest_addr;
|
|
||||||
std::memcpy(&ctr_dest_addr, dest_addr_buff.data(), sizeof(ctr_dest_addr));
|
|
||||||
|
|
||||||
s32 ret = -1;
|
s32 ret = -1;
|
||||||
if (addr_len > 0) {
|
if (addr_len > 0) {
|
||||||
|
CTRSockAddr ctr_dest_addr;
|
||||||
|
std::memcpy(&ctr_dest_addr, dest_addr_buff.data(), sizeof(ctr_dest_addr));
|
||||||
sockaddr dest_addr = CTRSockAddr::ToPlatform(ctr_dest_addr);
|
sockaddr dest_addr = CTRSockAddr::ToPlatform(ctr_dest_addr);
|
||||||
ret = ::sendto(socket_handle, reinterpret_cast<const char*>(input_buff.data()), len, flags,
|
ret = ::sendto(socket_handle, reinterpret_cast<const char*>(input_buff.data()), len, flags,
|
||||||
&dest_addr, sizeof(dest_addr));
|
&dest_addr, sizeof(dest_addr));
|
||||||
|
|
Loading…
Reference in a new issue