diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-07 15:58:57 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-07 15:58:57 +0100 |
commit | 58fe582b5d21d10d365954759fcb4c436b557810 (patch) | |
tree | 2a89ae956ce033551e16fcd825709251ece8c9b0 /src/plugins/fuzzy_check.c | |
parent | 1a0025def020ebdcc88f85c5e4a364ce9219de79 (diff) | |
download | rspamd-58fe582b5d21d10d365954759fcb4c436b557810.tar.gz rspamd-58fe582b5d21d10d365954759fcb4c436b557810.zip |
Fix the code for updated strings in HTTP library.
Diffstat (limited to 'src/plugins/fuzzy_check.c')
-rw-r--r-- | src/plugins/fuzzy_check.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index bc4822b17..6ca18aaf8 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -1549,26 +1549,23 @@ static gboolean fuzzy_controller_handler (struct rspamd_http_connection_entry *conn_ent, struct rspamd_http_message *msg, struct module_ctx *ctx, gint cmd) { - const GString *arg; - gchar *err_str; - gint value = 1, flag = 0; + const rspamd_ftok_t *arg; + glong value = 1, flag = 0; /* Get size */ arg = rspamd_http_message_find_header (msg, "Weight"); if (arg) { errno = 0; - value = strtol (arg->str, &err_str, 10); - if (*err_str != '\0' && *err_str != '\r') { - msg_info ("error converting numeric argument %v", arg); - value = 0; + + if (!rspamd_strtol (arg->begin, arg->len, &value)) { + msg_info ("error converting numeric argument %T", arg); } } arg = rspamd_http_message_find_header (msg, "Flag"); if (arg) { errno = 0; - flag = strtol (arg->str, &err_str, 10); - if (*err_str != '\0' && *err_str != '\r') { - msg_info ("error converting numeric argument %v", arg); + if (!rspamd_strtol (arg->begin, arg->len, &flag)) { + msg_info ("error converting numeric argument %T", arg); flag = 0; } } |