Skip to content

Commit

Permalink
Use socklen_t instead of unsigned int in call to accept.
Browse files Browse the repository at this point in the history
Not all platforms define `socklen_t` as `unsigned int`. E.g. Android
defines it as `int`.
iphydf committed Oct 6, 2016
1 parent 02e9cd3 commit 2569799
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions toxcore/TCP_server.c
Original file line number Diff line number Diff line change
@@ -1116,7 +1116,7 @@ static void do_TCP_accept_new(TCP_Server *TCP_server)

for (i = 0; i < TCP_server->num_listening_socks; ++i) {
struct sockaddr_storage addr;
unsigned int addrlen = sizeof(addr);
socklen_t addrlen = sizeof(addr);
sock_t sock;

do {
@@ -1323,7 +1323,7 @@ static void do_TCP_epoll(TCP_Server *TCP_server)
case TCP_SOCKET_LISTENING: {
//socket is from socks_listening, accept connection
struct sockaddr_storage addr;
unsigned int addrlen = sizeof(addr);
socklen_t addrlen = sizeof(addr);

while (1) {
sock_t sock_new = accept(sock, (struct sockaddr *)&addr, &addrlen);

0 comments on commit 2569799

Please sign in to comment.