Skip to content

Commit

Permalink
[NET] NetDll___WSAFDIsSet: Fixed incorrect endianness of fd_count
Browse files Browse the repository at this point in the history
Plus: limit it to 64 entries
Thanks to Bo98 for pointing that out
  • Loading branch information
Gliniak authored and gibbed committed Jun 10, 2023
1 parent 07e81fe commit 00aba94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/xenia/kernel/xam/xam_net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,9 @@ DECLARE_XAM_EXPORT1(NetDll_sendto, kNetworking, kImplemented);

dword_result_t NetDll___WSAFDIsSet_entry(dword_t socket_handle,
pointer_t<x_fd_set> fd_set) {
for (uint32_t i = 0; i < fd_set->fd_count.value; i++) {
const uint8_t max_fd_count =
std::min((uint32_t)fd_set->fd_count, uint32_t(64));
for (uint8_t i = 0; i < max_fd_count; i++) {
if (fd_set->fd_array[i] == socket_handle) {
return 1;
}
Expand Down

0 comments on commit 00aba94

Please sign in to comment.