diff options
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; |