aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-10-03 10:43:38 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-10-03 10:43:38 +0100
commit727326ae53e9ca72857c0dfc29753757ba72b170 (patch)
tree0bff8cd60d222055eb2e337674642ec70ec5687c /src
parente9f528631b5fe68cc5e4143bf51d411b414b118f (diff)
downloadrspamd-727326ae53e9ca72857c0dfc29753757ba72b170.tar.gz
rspamd-727326ae53e9ca72857c0dfc29753757ba72b170.zip
Fix chartable plugin.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/chartable.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c
index c1b8826e6..35af23d52 100644
--- a/src/plugins/chartable.c
+++ b/src/plugins/chartable.c
@@ -86,20 +86,18 @@ chartable_module_init (struct config_file *cfg, struct module_ctx **ctx)
gint
chartable_module_config (struct config_file *cfg)
{
- gchar *value;
+ rspamd_cl_object_t *value;
gint res = TRUE;
if ((value = get_module_opt (cfg, "chartable", "symbol")) != NULL) {
- chartable_module_ctx->symbol = memory_pool_strdup (chartable_module_ctx->chartable_pool, value);
+ chartable_module_ctx->symbol = rspamd_cl_obj_tostring (value);
}
else {
chartable_module_ctx->symbol = DEFAULT_SYMBOL;
}
if ((value = get_module_opt (cfg, "chartable", "threshold")) != NULL) {
- errno = 0;
- chartable_module_ctx->threshold = strtod (value, NULL);
- if (errno != 0) {
- msg_warn ("invalid numeric value '%s': %s", value, strerror (errno));
+ if (!rspamd_cl_obj_todouble_safe (value, &chartable_module_ctx->threshold)) {
+ msg_warn ("invalid numeric value");
chartable_module_ctx->threshold = DEFAULT_THRESHOLD;
}
}