Skip to content

Commit

Permalink
lsteamclient: Handle error result in networking_message_pool_receive_().
Browse files Browse the repository at this point in the history
CW-Bug-Id: #24177
  • Loading branch information
Paul Gofman committed Aug 27, 2024
1 parent 95282c8 commit 2f39b2e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lsteamclient/steam_networking_manual.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ static BOOL networking_message_pool_receive_144( int32_t capacity, int32_t count
struct networking_message_pool *pool = CONTAINING_RECORD( messages[0], struct networking_message, w_msg_144 )->pool;
int32_t i;

if (count < 0) count = 0;

for (i = count; i < capacity; i++)
{
messages[i]->m_pfnRelease( messages[i] );
Expand Down Expand Up @@ -155,11 +157,13 @@ static BOOL networking_message_pool_create_147( uint32_t count, w_SteamNetworkin
return TRUE;
}

static BOOL networking_message_pool_receive_147( uint32_t capacity, uint32_t count, w_SteamNetworkingMessage_t_147 **messages )
static BOOL networking_message_pool_receive_147( uint32_t capacity, int32_t count, w_SteamNetworkingMessage_t_147 **messages )
{
struct networking_message_pool *pool = CONTAINING_RECORD( messages[0], struct networking_message, w_msg_147 )->pool;
uint32_t i;

if (count < 0) count = 0;

for (i = count; i < capacity; i++)
{
messages[i]->m_pfnRelease( messages[i] );
Expand Down Expand Up @@ -227,11 +231,13 @@ static BOOL networking_message_pool_create_153a( uint32_t count, w_SteamNetworki
return TRUE;
}

static BOOL networking_message_pool_receive_153a( uint32_t capacity, uint32_t count, w_SteamNetworkingMessage_t_153a **messages )
static BOOL networking_message_pool_receive_153a( uint32_t capacity, int32_t count, w_SteamNetworkingMessage_t_153a **messages )
{
struct networking_message_pool *pool = CONTAINING_RECORD( messages[0], struct networking_message, w_msg_153a )->pool;
uint32_t i;

if (count < 0) count = 0;

for (i = count; i < capacity; i++)
{
messages[i]->m_pfnRelease( messages[i] );
Expand Down

0 comments on commit 2f39b2e

Please sign in to comment.