aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;