diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-09-23 22:33:34 +0000 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-09-23 22:33:34 +0000 |
commit | 8cdcbfc30301e65ecef8e8cc29fc67a5f05ada7d (patch) | |
tree | e0340071b1e6d5077878ad4827cd0a99a7e74034 /client.c | |
parent | 449b5181b9da37ca6e370d70757ecf3d7c6007ea (diff) |
maybe this works
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); |