diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-08-18 15:35:40 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-08-18 15:35:40 +0100 |
commit | cbdc8b0cf6dd7328f124886c7efd1b13b0165423 (patch) | |
tree | fbe849bb24513a89ec4c50ce560cb4c5bddb6a97 | |
parent | 80347a1396a93e68c71214a70dddd2c01964250e (diff) | |
download | rspamd-cbdc8b0cf6dd7328f124886c7efd1b13b0165423.tar.gz rspamd-cbdc8b0cf6dd7328f124886c7efd1b13b0165423.zip |
Backport parse_hostport_priority fix.rspamd-0.6
-rw-r--r-- | src/cfg_utils.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cfg_utils.c b/src/cfg_utils.c index d2e61cbfd..930eb1fb5 100644 --- a/src/cfg_utils.c +++ b/src/cfg_utils.c @@ -105,18 +105,19 @@ parse_host_port_priority_strv (memory_pool_t *pool, gchar **tokens, } } if (priority != NULL) { + const gchar *tok; if (port != NULL) { - cur_tok = tokens[2]; + tok = tokens[2]; } else { - cur_tok = tokens[1]; + tok = tokens[1]; } - if (cur_tok != NULL) { + if (tok != NULL) { /* Priority part */ errno = 0; - priority_parsed = strtoul (cur_tok, &err_str, 10); + priority_parsed = strtoul (tok, &err_str, 10); if (*err_str != '\0' || errno != 0) { - msg_warn ("cannot parse priority: %s, at symbol %c, error: %s", tokens[1], *err_str, strerror (errno)); + msg_warn ("cannot parse priority: %s, at symbol %c, error: %s", tok, *err_str, strerror (errno)); } else { *priority = priority_parsed; |