From 550643281e50d32017095e3953eeb5c58c1493fe Mon Sep 17 00:00:00 2001 From: Rockingcool Date: Tue, 12 Mar 2024 09:44:41 -0500 Subject: [PATCH] Replace all instances of sockaddr with sockaddr_storage --- sock.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sock.cpp b/sock.cpp index 7c510a5..c01bef5 100644 --- a/sock.cpp +++ b/sock.cpp @@ -50,7 +50,7 @@ void Sock::sendAll(std::string to_send) { /* For UDP sockets */ if (this->protocol == ES_UDP) { - sendto(this->sock_fd, to_send.data(), str_length, 0, dest, addrlen); + sendto(this->sock_fd, to_send.data(), str_length, 0, (struct sockaddr *)dest, addrlen); } /* For TCP sockets */ else { @@ -85,7 +85,7 @@ char* Sock::recvAll() { bool has_been_read = false; if (this->protocol == ES_UDP) { - num_bytes_received = recvfrom(this->sock_fd, buffer, 99, 0, dest, &addrlen); + num_bytes_received = recvfrom(this->sock_fd, buffer, 99, 0, (struct sockaddr *)dest, &addrlen); if (num_bytes_received == 0) { return NULL; }