diff options
| author | Mario Kilies <MarioKilies@GMX.net> | 2011-01-16 08:41:04 +0100 |
|---|---|---|
| committer | Mario Kilies <MarioKilies@GMX.net> | 2011-01-16 08:41:04 +0100 |
| commit | 4b9e56ebf47db8be740f4ff2a4b9fceb9f143055 (patch) | |
| tree | d6a31f6e068914a2ec1820da594c9d1c5ea2604e /src/net_client.c | |
| parent | fac5e3de0929c3abb73da552efbda6d641136588 (diff) | |
Refactored cardstack and tablestacks to card_stack_t and table_stacks_t, that both now are defined as structs rather than arrays. Inserted lots of assert() calls to functions that take pointers as arguments.
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; } - |
