added another type cast to socket handling

This commit is contained in:
Logan oos Even
2021-09-13 15:07:34 +05:45
committed by GitHub
parent 46205c6cff
commit 8eb13165d4
+1 -1
View File
@@ -34,7 +34,7 @@ SOCKET open_socket (int local_port, in_addr_t address, int type /* 0 = UDP, TCP
struct sockaddr_in local_address;
int sockopt;
if((sock_fd = socket(PF_INET, ((type == 0) ? SOCK_DGRAM : SOCK_STREAM) , 0)) < 0) {
if((int)(sock_fd = socket(PF_INET, ((type == 0) ? SOCK_DGRAM : SOCK_STREAM) , 0)) < 0) {
traceEvent(TRACE_ERROR, "Unable to create socket [%s][%d]\n",
strerror(errno), sock_fd);
return(-1);