summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRyan Loebs <obsidianx@gmail.com>2016-03-29 13:42:58 +0200
committerRyan Loebs <obsidianx@gmail.com>2016-03-29 13:42:58 +0200
commit65883d9327030adb33938c9b0de276b4cfd74a46 (patch)
tree30f33b0eb1c52f061f380e2048700f1c0c303645 /src
parentSOC Updates (diff)
downloadyuzu-65883d9327030adb33938c9b0de276b4cfd74a46.tar
yuzu-65883d9327030adb33938c9b0de276b4cfd74a46.tar.gz
yuzu-65883d9327030adb33938c9b0de276b4cfd74a46.tar.bz2
yuzu-65883d9327030adb33938c9b0de276b4cfd74a46.tar.lz
yuzu-65883d9327030adb33938c9b0de276b4cfd74a46.tar.xz
yuzu-65883d9327030adb33938c9b0de276b4cfd74a46.tar.zst
yuzu-65883d9327030adb33938c9b0de276b4cfd74a46.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/soc_u.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp
index efda8bd4f..ea301f71f 100644
--- a/src/core/hle/service/soc_u.cpp
+++ b/src/core/hle/service/soc_u.cpp
@@ -568,7 +568,7 @@ static void RecvFrom(Service::Interface* self) {
socklen_t src_addr_len = sizeof(src_addr);
int ret = ::recvfrom(socket_handle, (char*)output_buff, len, flags, &src_addr, &src_addr_len);
- if (buffer_parameters.output_src_address_buffer != 0 && src_addr_len > 0) {
+ if (ret >= 0 && buffer_parameters.output_src_address_buffer != 0 && src_addr_len > 0) {
CTRSockAddr* ctr_src_addr = reinterpret_cast<CTRSockAddr*>(Memory::GetPointer(buffer_parameters.output_src_address_buffer));
*ctr_src_addr = CTRSockAddr::FromPlatform(src_addr);
}
@@ -736,7 +736,7 @@ static void GetSockOpt(Service::Interface* self) {
// >> 2 = convert to u32 offset instead of byte offset (cmd_buffer = u32*)
u8* optval = Memory::GetPointer(cmd_buffer[0x104 >> 2]);
- int ret = ::getsockopt(socket_handle, level, optname, &optval, &optlen);
+ int ret = ::getsockopt(socket_handle, level, optname, optval, &optlen);
int err = 0;
if(ret == SOCKET_ERROR_VALUE) {
err = TranslateError(GET_ERRNO);
@@ -754,11 +754,11 @@ static void SetSockOpt(Service::Interface* self) {
u32 level = cmd_buffer[2];
u32 optname = cmd_buffer[3];
socklen_t optlen = static_cast<socklen_t>(cmd_buffer[4]);
- void *optval = Memory::GetPointer(cmd_buffer[8]);
+ u8 *optval = Memory::GetPointer(cmd_buffer[8]);
int ret = static_cast<u32>(::setsockopt(socket_handle, level, optname, optval, optlen));
int err = 0;
- if(ret == SOCKET_ERROR_VALUE) {
+ if (ret == SOCKET_ERROR_VALUE) {
err = TranslateError(GET_ERRNO);
}