mirror of
https://github.com/citra-emu/citra-nightly.git
synced 2024-12-25 08:15:38 +00:00
do not init and copy to ctr_dest_addr unless have data
This commit is contained in:
parent
3b736a72a5
commit
e8bb79be2d
|
@ -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