From 702b610636012b8f9247c3bbc1d39cd8bddde7b2 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 23 Aug 2020 23:39:06 -0400 Subject: tighter variable scope --- client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client.c b/client.c index 1561590..61d1fec 100644 --- a/client.c +++ b/client.c @@ -269,7 +269,6 @@ void client_connected_loop_iteration(uint32_t friendnumber, struct tox_timer *t) static unsigned char tox_packet_buf[PROTOCOL_MAX_PACKET_SIZE]; static fd_set fds; - int accept_fd = 0; int select_rv = 0; tunnel *tmp = NULL; tunnel *tun = NULL; @@ -279,8 +278,8 @@ void client_connected_loop_iteration(uint32_t friendnumber, struct tox_timer *t) /* Handle accepting new connections */ if(client_tunnel.sockfd <= 0) /* Don't accept if we're already waiting to establish a tunnel */ { - accept_fd = accept(bind_sockfd, NULL, NULL); log_printf(L_DEBUG4, "calling accept(%d)", bind_sockfd); + int accept_fd = accept(bind_sockfd, NULL, NULL); if(accept_fd != -1) { log_printf(L_INFO, "Accepting a new connection - requesting tunnel...\n"); -- cgit v1.2.3