diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-16 16:14:43 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-16 16:14:43 +0100 |
commit | cf8665ebe3f5a2acdc740076a70cd8df6f73d8f3 (patch) | |
tree | 70d936f1c55d9694198f42c80c1197f82ced5d36 | |
parent | 9865ad6ea49693e32ca8be832e0220d47bbf0127 (diff) | |
download | rspamd-cf8665ebe3f5a2acdc740076a70cd8df6f73d8f3.tar.gz rspamd-cf8665ebe3f5a2acdc740076a70cd8df6f73d8f3.zip |
[Minor] Fix some calcs
-rw-r--r-- | src/libserver/composites/composites.cxx | 3 | ||||
-rw-r--r-- | src/libserver/composites/composites_internal.hxx | 2 | ||||
-rw-r--r-- | src/libserver/composites/composites_manager.cxx | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/libserver/composites/composites.cxx b/src/libserver/composites/composites.cxx index b03edaf71..99a2038c3 100644 --- a/src/libserver/composites/composites.cxx +++ b/src/libserver/composites/composites.cxx @@ -88,7 +88,8 @@ struct composites_data { explicit composites_data(struct rspamd_task *task, struct rspamd_scan_result *mres) : task(task), composite(nullptr), metric_res(mres) { - checked.resize(rspamd_composites_manager_nelts(task->cfg->composites_manager) * 2); + checked.resize(rspamd_composites_manager_nelts(task->cfg->composites_manager) * 2, + false); } }; diff --git a/src/libserver/composites/composites_internal.hxx b/src/libserver/composites/composites_internal.hxx index 12fa3ecb2..c38f3d377 100644 --- a/src/libserver/composites/composites_internal.hxx +++ b/src/libserver/composites/composites_internal.hxx @@ -57,7 +57,7 @@ public: } auto size(void) const -> std::size_t { - return composites.size(); + return all_composites.size(); } auto find(std::string_view name) const -> const rspamd_composite * { diff --git a/src/libserver/composites/composites_manager.cxx b/src/libserver/composites/composites_manager.cxx index c2e719c89..cf91d1136 100644 --- a/src/libserver/composites/composites_manager.cxx +++ b/src/libserver/composites/composites_manager.cxx @@ -87,7 +87,7 @@ composites_manager::add_composite(std::string_view composite_name, const ucl_obj auto &composite = all_composites.emplace_back(std::make_shared<rspamd_composite>()); composite->expr = expr; - composite->id = all_composites.size(); + composite->id = all_composites.size() - 1; composite->str_expr = composite_expression; composite->sym = composite_name; |