diff options
author | cflip <cflip@cflip.net> | 2022-09-19 21:53:40 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-09-19 21:58:21 -0600 |
commit | 8ce7db9ba907ad4e826c826af898e1864f25f7bb (patch) | |
tree | 813b6862c25277856952f279f0614c0ce10d8053 /src/main.cpp | |
parent | bcea88142033f37bffeca4df096fb7795ebf7020 (diff) |
Add ClangTidy configuration and apply fixes
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index d8c343a..89a8139 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,7 +10,7 @@ #include "HttpResponse.h" #include "ServerConnection.h" -static HttpResponse serve_from_filesystem(HttpRequest request) +static HttpResponse serve_from_filesystem(const HttpRequest& request) { namespace fs = std::filesystem; @@ -50,7 +50,7 @@ static HttpResponse serve_from_filesystem(HttpRequest request) return response; } -static HttpResponse serve_from_cgi(const std::string& script_path, HttpRequest request) +static HttpResponse serve_from_cgi(const std::string& script_path, const HttpRequest& request) { HttpResponse response; response.add_header("Server", "cfws"); @@ -85,8 +85,8 @@ static HttpResponse serve_from_cgi(const std::string& script_path, HttpRequest r } static option long_options[] = { - { "cgi", required_argument, NULL, 'c' }, - { "port", required_argument, NULL, 'p' }, + { "cgi", required_argument, nullptr, 'c' }, + { "port", required_argument, nullptr, 'p' }, }; int main(int argc, char** argv) @@ -95,7 +95,7 @@ int main(int argc, char** argv) bool in_cgi_mode = false; std::string cgi_program_name; - int c; + int c = 0; int option_index = 0; while ((c = getopt_long(argc, argv, "c:p:", long_options, &option_index)) != -1) { switch (c) { |