diff options
Diffstat (limited to 'src/net_client.c')
| -rw-r--r-- | src/net_client.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/net_client.c b/src/net_client.c index a225529..895041e 100644 --- a/src/net_client.c +++ b/src/net_client.c @@ -16,6 +16,8 @@ */ void client_hello(int sock, const char* username) { + assert(username != NULL); + uint8_t* buf; uint8_t namelen = strlen(username); @@ -43,6 +45,9 @@ void client_hello(int sock, const char* username) */ int client_connect_server(const char* host, const char* port) { + assert(host != NULL); + assert(port != NULL); + int status; int sock; struct addrinfo hints, *result, *tmp; @@ -85,6 +90,8 @@ int client_connect_server(const char* host, const char* port) player_list* client_recv_player_list(const uint8_t* payload, const uint8_t data_len) { + assert(payload != NULL); + player_list* players; uint32_t pos = 0; @@ -112,6 +119,8 @@ player_list* client_recv_player_list(const uint8_t* payload, const uint8_t data_ hand_t *client_recv_deal_cards(const uint8_t* payload, const uint8_t payload_len) { + assert(payload != NULL); + hand_t *h = malloc(sizeof(hand_t)); assert(payload_len == MAX_HAND_CARDS); // deal_cards packet have fixed size @@ -123,4 +132,3 @@ hand_t *client_recv_deal_cards(const uint8_t* payload, const uint8_t payload_len return h; } - |
