From dc07fc54179f041812bed0b58934872f4f01b4e5 Mon Sep 17 00:00:00 2001 From: sbruceheart <105746677+sbruceheart@users.noreply.github.com> Date: Wed, 29 Jun 2022 18:34:06 -0400 Subject: [PATCH] Remove unused variables mlen, uri_len Remove unused variables that are set with no visible side effect. /usr/bin/clang-14 -Wall -Wextra -Werror -Wshadow -Wno-sign-compare -Wno-pragmas -Wno-tautological-pointer-compare Results in civetweb/src/civetweb.c:8769:12: error: unused variable 'mlen' [-Werror,-Wunused-variable] size_t mlen = strlen(workdata->f_user) ^ civetweb/src/civetweb.c:14621:6: error: variable 'uri_len' set but not used [-Werror,-Wunused-but-set-variable] int uri_len, ssl_index; --- src/civetweb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/civetweb.c b/src/civetweb.c index 76cb6c5aa..51120cbb0 100644 --- a/src/civetweb.c +++ b/src/civetweb.c @@ -14618,7 +14618,7 @@ handle_request(struct mg_connection *conn) { struct mg_request_info *ri = &conn->request_info; char path[UTF8_PATH_MAX]; - int uri_len, ssl_index; + int ssl_index; int is_found = 0, is_script_resource = 0, is_websocket_request = 0, is_put_or_delete_request = 0, is_callback_resource = 0, is_template_text_file = 0, is_webdav_request = 0; @@ -14671,7 +14671,6 @@ handle_request(struct mg_connection *conn) } return; } - uri_len = (int)strlen(ri->local_uri); /* 1.3. decode url (if config says so) */ if (should_decode_url(conn)) {