diff options
-rw-r--r-- | src/cli/tls_client.cpp | 5 | ||||
-rw-r--r-- | src/cli/tls_server.cpp | 6 | ||||
-rw-r--r-- | src/lib/utils/http_util/http_util.cpp | 2 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/cli/tls_client.cpp b/src/cli/tls_client.cpp index b97688386..de7e08086 100644 --- a/src/cli/tls_client.cpp +++ b/src/cli/tls_client.cpp @@ -240,7 +240,7 @@ class TLS_Client final : public Command, public Botan::TLS::Callbacks socket_info.sin_addr = *reinterpret_cast<struct in_addr*>(host_addr->h_addr); // FIXME - if(::connect(fd, (sockaddr*)&socket_info, sizeof(struct sockaddr)) != 0) + if(::connect(fd, reinterpret_cast<sockaddr*>(&socket_info), sizeof(struct sockaddr)) != 0) { ::close(fd); throw CLI_Error("connect failed"); @@ -289,8 +289,7 @@ class TLS_Client final : public Command, public Botan::TLS::Callbacks while(length) { - ssize_t sent = ::send(m_sockfd, (const char*)buf + offset, - length, MSG_NOSIGNAL); + ssize_t sent = ::send(m_sockfd, buf + offset, length, MSG_NOSIGNAL); if(sent == -1) { diff --git a/src/cli/tls_server.cpp b/src/cli/tls_server.cpp index 7fc38cf31..dd1c7f450 100644 --- a/src/cli/tls_server.cpp +++ b/src/cli/tls_server.cpp @@ -92,10 +92,10 @@ class TLS_Server final : public Command socklen_t from_len = sizeof(sockaddr_in); if(::recvfrom(server_fd, nullptr, 0, MSG_PEEK, - (struct sockaddr*)&from, &from_len) != 0) + reinterpret_cast<struct sockaddr*>(&from), &from_len) != 0) throw CLI_Error("Could not peek next packet"); - if(::connect(server_fd, (struct sockaddr*)&from, from_len) != 0) + if(::connect(server_fd, reinterpret_cast<struct sockaddr*>(&from), from_len) != 0) throw CLI_Error("Could not connect UDP socket"); fd = server_fd; @@ -192,7 +192,7 @@ class TLS_Server final : public Command // FIXME: support limiting listeners socket_info.sin_addr.s_addr = INADDR_ANY; - if(::bind(fd, (sockaddr*)&socket_info, sizeof(struct sockaddr)) != 0) + if(::bind(fd, reinterpret_cast<struct sockaddr*>(&socket_info), sizeof(struct sockaddr)) != 0) { ::close(fd); throw CLI_Error("server bind failed"); diff --git a/src/lib/utils/http_util/http_util.cpp b/src/lib/utils/http_util/http_util.cpp index 85bd1828b..970b90238 100644 --- a/src/lib/utils/http_util/http_util.cpp +++ b/src/lib/utils/http_util/http_util.cpp @@ -91,7 +91,7 @@ std::string http_transact(const std::string& hostname, socket_info.sin_addr = *reinterpret_cast<struct in_addr*>(host_addr->h_addr); // FIXME - if(::connect(fd, (sockaddr*)&socket_info, sizeof(struct sockaddr)) != 0) + if(::connect(fd, reinterpret_cast<sockaddr*>(&socket_info), sizeof(struct sockaddr)) != 0) throw HTTP_Error("HTTP connection to " + hostname + " failed"); size_t sent_so_far = 0; |