diff options
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -154,13 +154,13 @@ void *reply_thread_routine(void* args) { if (reply_type == 2) { // we have a welcome message // recv the message, check for errors too - int16_t num_stations = -1; + char* num_stations = -1; int bytes_to_read = sizeof(uint16_t); if (recv_all(sockfd, &num_stations, &bytes_to_read) == -1) { perror("recv_all"); exit(1); } - num_stations = ntohs(num_stations); + num_stations = ntohs((uint16_t) num_stations); fflush(stdout); printf("Welcome to Snowcast! The server has %d stations.\n", num_stations); fflush(stdout); |