mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Fix regression test and example: checking if rules are loaded ok
It was checking only the amount of rules loaded, which could be 0 if only configuration directives are loaded.
This commit is contained in:
@@ -38,7 +38,7 @@ int main (int argc, char **argv)
|
||||
rules = msc_create_rules_set();
|
||||
|
||||
ret = msc_rules_add_file(rules, main_rule_uri, &error);
|
||||
if (ret == 0) {
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Problems loading the rules --\n");
|
||||
fprintf(stderr, "%s\n", error);
|
||||
goto end;
|
||||
@@ -48,7 +48,7 @@ int main (int argc, char **argv)
|
||||
ret = msc_rules_add_remote(rules, "test",
|
||||
"https://www.modsecurity.org/modsecurity-regression-test-secremoterules.txt",
|
||||
&error);
|
||||
if (ret == 0) {
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Problems loading the rules --\n");
|
||||
fprintf(stderr, "%s\n", error);
|
||||
goto end;
|
||||
|
Reference in New Issue
Block a user