From: benno Date: Mon, 30 Jul 2018 09:59:03 +0000 (+0000) Subject: cleanup initialization of chngdir. inspired by Ross L Richardson. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=377310773d6ef071ec5651ae59288610bd726bb7;p=openbsd cleanup initialization of chngdir. inspired by Ross L Richardson. ok tb@ --- diff --git a/usr.sbin/acme-client/main.c b/usr.sbin/acme-client/main.c index 4bbc2506f4c..d96bf40e036 100644 --- a/usr.sbin/acme-client/main.c +++ b/usr.sbin/acme-client/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.40 2018/07/30 09:56:50 benno Exp $ */ +/* $Id: main.c,v 1.41 2018/07/30 09:59:03 benno Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons * @@ -160,13 +160,10 @@ main(int argc, char *argv[]) /* XXX replace with existance check in parse.y */ err(EXIT_FAILURE, "no account key in config?"); } - if (domain->challengedir == NULL) - chngdir = strdup(WWW_DIR); - else - chngdir = domain->challengedir; - if (chngdir == NULL) - err(EXIT_FAILURE, "strdup"); + if ((chngdir = domain->challengedir) == NULL) + if ((chngdir = strdup(WWW_DIR)) == NULL) + err(EXIT_FAILURE, "strdup"); /* * Do some quick checks to see if our paths exist.