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/CGIScript.cpp | |
parent | bcea88142033f37bffeca4df096fb7795ebf7020 (diff) |
Add ClangTidy configuration and apply fixes
Diffstat (limited to 'src/CGIScript.cpp')
-rw-r--r-- | src/CGIScript.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/CGIScript.cpp b/src/CGIScript.cpp index a29f1eb..8731023 100644 --- a/src/CGIScript.cpp +++ b/src/CGIScript.cpp @@ -17,20 +17,20 @@ CGIScript::~CGIScript() { pclose(m_pipe); - for (auto key : m_environment_variables) + for (const auto* key : m_environment_variables) unsetenv(key); } void CGIScript::set_environment(const char* key, const char* value) { m_environment_variables.push_back(key); - setenv(key, value, true); + setenv(key, value, 1); } bool CGIScript::open() { m_pipe = popen(m_script_path.c_str(), "r"); - if (!m_pipe) { + if (m_pipe == nullptr) { perror("cfws: popen"); return false; } @@ -43,7 +43,7 @@ std::string CGIScript::read_output() { std::stringstream sstream; - char ch; + char ch = 0; while ((ch = fgetc(m_pipe)) != EOF) sstream << ch; |