From 8cdcbfc30301e65ecef8e8cc29fc67a5f05ada7d Mon Sep 17 00:00:00 2001 From: sotech117 Date: Sat, 23 Sep 2023 22:33:34 +0000 Subject: maybe this works --- client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 35d1a10..19fd9d8 100644 --- a/client.c +++ b/client.c @@ -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); -- cgit v1.2.3-70-g09d2