X-Git-Url: http://git.madism.org/?p=apps%2Fpfixtools.git;a=blobdiff_plain;f=postlicyd%2Fstrlist.c;h=0c790cb1dc5283c0efd1da262eee9693339ad54e;hp=2f17f902f070b83f47f00522e26955d3a4aee845;hb=59b8220d0227fe68537a563b3e5fa2e63e26bc0d;hpb=8d29aaadbe12876d2b36ba65217013f60cb1f6cc diff --git a/postlicyd/strlist.c b/postlicyd/strlist.c index 2f17f90..0c790cb 100644 --- a/postlicyd/strlist.c +++ b/postlicyd/strlist.c @@ -285,7 +285,7 @@ static bool strlist_filter_constructor(filter_t *filter) lock = false; } else { PARSE_CHECK(false, "illegal locking state %.*s", - p - current, current); + (int)(p - current), current); } break; @@ -301,7 +301,7 @@ static bool strlist_filter_constructor(filter_t *filter) reverse = false; } else { PARSE_CHECK(false, "illegal character order value %.*s", - p - current, current); + (int)(p - current), current); } break; @@ -309,7 +309,7 @@ static bool strlist_filter_constructor(filter_t *filter) weight = strtol(current, &next, 10); PARSE_CHECK(next == p && weight >= 0 && weight <= 1024, "illegal weight value %.*s", - (p - current), current); + (int)(p - current), current); break; case 3: @@ -358,7 +358,7 @@ static bool strlist_filter_constructor(filter_t *filter) lock = false; } else { PARSE_CHECK(false, "illegal locking state %.*s", - p - current, current); + (int)(p - current), current); } break; @@ -366,7 +366,7 @@ static bool strlist_filter_constructor(filter_t *filter) weight = strtol(current, &next, 10); PARSE_CHECK(next == p && weight >= 0 && weight <= 1024, "illegal weight value %.*s", - (p - current), current); + (int)(p - current), current); break; case 2: @@ -412,7 +412,7 @@ static bool strlist_filter_constructor(filter_t *filter) weight = strtol(current, &next, 10); PARSE_CHECK(next == p && weight >= 0 && weight <= 1024, "illegal weight value %.*s", - (p - current), current); + (int)(p - current), current); break; case 1: @@ -470,7 +470,7 @@ static bool strlist_filter_constructor(filter_t *filter) CASE(RECIPIENT, recipient, email); #undef CASE default: - PARSE_CHECK(false, "unknown field %.*s", p - current, current); + PARSE_CHECK(false, "unknown field %.*s", (int)(p - current), current); break; } if (!*p) { @@ -487,7 +487,7 @@ static bool strlist_filter_constructor(filter_t *filter) PARSE_CHECK(config->is_email != config->is_hostname, "matched field MUST be emails XOR hostnames"); - PARSE_CHECK(config->tries.len, + PARSE_CHECK(config->tries.len || config->host_offsets.len, "no file parameter in the filter %s", filter->name); filter->data = config; return true; @@ -543,7 +543,7 @@ static filter_result_t strlist_filter(const filter_t *filter, const query_t *que if (config->match_ ## Flag) { \ const int len = m_strlen(query->Field); \ strlist_copy(normal, query->Field, len, false); \ - for (uint32_t i = 0 ; len > 0 && i < config->tries.len ; ++i) { \ + for (uint32_t i = 0 ; len > 0 && i < config->host_offsets.len ; ++i) { \ const char *rbl = array_ptr(config->hosts, \ array_elt(config->host_offsets, i));\ const int weight = array_elt(config->host_weights, i); \