From 407a1f3e95f617c1cd9ecab8fc7df09aca6e80af Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Tue, 1 Mar 2016 17:06:07 +0000 Subject: [PATCH] Tidy parsing code. --- src/option.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/option.c b/src/option.c index 12c0468..c1f8b5a 100644 --- a/src/option.c +++ b/src/option.c @@ -1990,11 +1990,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma comma = split(arg); daemon->soa_retry = (u32)atoi(arg); if (comma) - { - arg = comma; - comma = split(arg); - daemon->soa_expiry = (u32)atoi(arg); - } + daemon->soa_expiry = (u32)atoi(comma); } } } @@ -3907,13 +3903,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma if (!atoi_check16(arg, &priority)) ret_err(_("invalid priority")); - if (comma) - { - arg = comma; - comma = split(arg); - if (!atoi_check16(arg, &weight)) - ret_err(_("invalid weight")); - } + if (comma && !atoi_check16(comma, &weight)) + ret_err(_("invalid weight")); } } }