aboutsummaryrefslogtreecommitdiffstats
path: root/src/spf.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-09-24 12:19:52 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-09-24 12:19:52 +0100
commit12df275efe7e4bd45c40c8287be587b422ea39ca (patch)
tree772b7fe3a06da00b32b1aaf2f524460e4f4adf07 /src/spf.c
parent55aa9f063dfd50d5714f52a550d0b39cd6079fee (diff)
downloadrspamd-12df275efe7e4bd45c40c8287be587b422ea39ca.tar.gz
rspamd-12df275efe7e4bd45c40c8287be587b422ea39ca.zip
Parse masks with a single number correctly.
Diffstat (limited to 'src/spf.c')
-rw-r--r--src/spf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/spf.c b/src/spf.c
index 18fdeb412..456d53952 100644
--- a/src/spf.c
+++ b/src/spf.c
@@ -314,7 +314,7 @@ parse_spf_ipmask (const gchar *begin, struct spf_addr *addr)
if (state == 2) {
/* Also parse mask */
if (!addr->data.normal.ipv6) {
- addr->data.normal.mask = (mask_buf[0] - '0') * 10 + mask_buf[1] - '0';
+ addr->data.normal.mask = strtoul (mask_buf, NULL, 10);
if (addr->data.normal.mask > 32) {
msg_info ("bad ipmask value: '%s'", begin);
return FALSE;