mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Change some args from pass-by-value (satisfies cppcheck)
This commit is contained in:
parent
d2a1080db2
commit
c3b7a7f4f0
@ -151,7 +151,7 @@ std::list<std::string> expandEnv(const std::string& var, int flags) {
|
|||||||
return vars;
|
return vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool createDir(std::string dir, int mode, std::string *error) {
|
bool createDir(const std::string& dir, int mode, std::string *error) {
|
||||||
int ret = mkdir(dir.data(), mode);
|
int ret = mkdir(dir.data(), mode);
|
||||||
if (ret != 0 && errno != EEXIST) {
|
if (ret != 0 && errno != EEXIST) {
|
||||||
error->assign("Not able to create directory: " + dir + ": " \
|
error->assign("Not able to create directory: " + dir + ": " \
|
||||||
@ -163,7 +163,7 @@ bool createDir(std::string dir, int mode, std::string *error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool isFile(std::string f) {
|
bool isFile(const std::string& f) {
|
||||||
struct stat fileInfo;
|
struct stat fileInfo;
|
||||||
FILE *fp = fopen(f.c_str(), "r");
|
FILE *fp = fopen(f.c_str(), "r");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
|
@ -33,8 +33,8 @@ std::string find_resource(const std::string& file, const std::string& config,
|
|||||||
std::string *err);
|
std::string *err);
|
||||||
std::string get_path(const std::string& file);
|
std::string get_path(const std::string& file);
|
||||||
std::list<std::string> expandEnv(const std::string& var, int flags);
|
std::list<std::string> expandEnv(const std::string& var, int flags);
|
||||||
bool createDir(std::string dir, int mode, std::string *error);
|
bool createDir(const std::string& dir, int mode, std::string *error);
|
||||||
bool isFile(std::string f);
|
bool isFile(const std::string& f);
|
||||||
|
|
||||||
} // namespace utils
|
} // namespace utils
|
||||||
} // namespace modsecurity
|
} // namespace modsecurity
|
||||||
|
@ -62,8 +62,6 @@ ctunullpointer:src/rule_with_operator.cc:95
|
|||||||
passedByValue:src/variables/global.h:109
|
passedByValue:src/variables/global.h:109
|
||||||
passedByValue:src/variables/global.h:110
|
passedByValue:src/variables/global.h:110
|
||||||
passedByValue:src/parser/driver.cc:45
|
passedByValue:src/parser/driver.cc:45
|
||||||
passedByValue:src/utils/system.cc:154
|
|
||||||
passedByValue:src/utils/system.cc:166
|
|
||||||
passedByValue:test/common/modsecurity_test.cc:49
|
passedByValue:test/common/modsecurity_test.cc:49
|
||||||
passedByValue:test/common/modsecurity_test.cc:98
|
passedByValue:test/common/modsecurity_test.cc:98
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user