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:
Felipe Zimmerle
2015-08-25 07:31:27 -03:00
parent e94226f1d8
commit 15893e312b
2 changed files with 3 additions and 3 deletions

View File

@@ -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;