mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Code cosmetics: reduce the amount of cppcheck warnings
This commit is contained in:
@@ -45,7 +45,6 @@ std::string ModSecurityTest<T>::header() {
|
||||
|
||||
template <class T>
|
||||
bool ModSecurityTest<T>::load_test_json(std::string file) {
|
||||
std::vector<yajl_val> tests;
|
||||
char errbuf[1024];
|
||||
yajl_val node;
|
||||
|
||||
@@ -128,9 +127,8 @@ std::pair<std::string, std::vector<T *>>* ModSecurityTest<T>::load_tests() {
|
||||
|
||||
template <class T>
|
||||
void ModSecurityTest<T>::cmd_options(int argc, char **argv) {
|
||||
int option_char;
|
||||
|
||||
#if HAS_GETOPT
|
||||
int option_char;
|
||||
GetOpt getopt(argc, argv, "hvct:");
|
||||
|
||||
while ((option_char = getopt()) != EOF) {
|
||||
|
@@ -58,13 +58,12 @@ void print_help() {
|
||||
|
||||
void perform_unit_test(UnitTest *t, ModSecurityTestResults<UnitTest>* res) {
|
||||
const char *error = NULL;
|
||||
int ret = 0;
|
||||
|
||||
if (t->type == "op") {
|
||||
Operator *op = Operator::instantiate("\"@" + t->name + \
|
||||
" " + t->param + "\"");
|
||||
op->init(&error);
|
||||
ret = op->evaluate(NULL, t->input);
|
||||
int ret = op->evaluate(NULL, t->input);
|
||||
if (ret != t->ret) {
|
||||
t->obtained = ret;
|
||||
res->push_back(t);
|
||||
|
Reference in New Issue
Block a user