From ab612583493e500ba671447a49c3c567b1446f41 Mon Sep 17 00:00:00 2001 From: "F. Duncanh" Date: Fri, 20 Mar 2026 15:21:21 -0400 Subject: [PATCH] clean up global use of loop variable i in httpd.c thread --- lib/httpd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/httpd.c b/lib/httpd.c index 64eb621..b38d904 100644 --- a/lib/httpd.c +++ b/lib/httpd.c @@ -349,7 +349,6 @@ httpd_thread(void *arg) char http[] = "HTTP/1.1"; char event[] = "EVENT/1.0"; char buffer[1024]; - int i = 0; bool logger_debug = (logger_get_level(httpd->logger) >= LOGGER_DEBUG); assert(httpd); @@ -389,7 +388,7 @@ httpd_thread(void *arg) } } } - for (i=0; imax_connections; i++) { + for (int i = 0; i < httpd->max_connections; i++) { int socket_fd; if (!httpd->connections[i].connected) { continue; @@ -432,7 +431,7 @@ httpd_thread(void *arg) continue; } } - for (i=0; imax_connections; i++) { + for (int i = 0; i < httpd->max_connections; i++) { http_connection_t *connection = &httpd->connections[i]; if (!connection->connected) { @@ -609,7 +608,7 @@ httpd_thread(void *arg) } /* Remove all connections that are still connected */ - for (i=0; imax_connections; i++) { + for (int i = 0; i < httpd->max_connections; i++) { http_connection_t *connection = &httpd->connections[i]; if (!connection->connected) {