aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-23 22:33:34 +0000
committersotech117 <michael_foiani@brown.edu>2023-09-23 22:33:34 +0000
commit8cdcbfc30301e65ecef8e8cc29fc67a5f05ada7d (patch)
treee0340071b1e6d5077878ad4827cd0a99a7e74034
parent449b5181b9da37ca6e370d70757ecf3d7c6007ea (diff)
maybe this works
-rw-r--r--client.c4
-rwxr-xr-xsnowcast_controlbin26608 -> 26552 bytes
2 files changed, 2 insertions, 2 deletions
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);
diff --git a/snowcast_control b/snowcast_control
index 264d8c3..f3549e3 100755
--- a/snowcast_control
+++ b/snowcast_control
Binary files differ