From d31476be203112a975b093e00645e456b5a5777f Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 13 Sep 2016 16:04:52 +0000 Subject: Inconsistant use of case (value): idiom drives me nuts, I have no idea what purpose it was intended to serve. --- usr.sbin/acme-client/acctproc.c | 6 +++--- usr.sbin/acme-client/json.c | 10 +++++----- usr.sbin/acme-client/main.c | 30 +++++++++++++++--------------- 3 files changed, 23 insertions(+), 23 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/acme-client/acctproc.c b/usr.sbin/acme-client/acctproc.c index d17a645b363..eb2da4482e5 100644 --- a/usr.sbin/acme-client/acctproc.c +++ b/usr.sbin/acme-client/acctproc.c @@ -1,4 +1,4 @@ -/* $Id: acctproc.c,v 1.6 2016/09/13 16:01:37 deraadt Exp $ */ +/* $Id: acctproc.c,v 1.7 2016/09/13 16:04:51 deraadt Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons * @@ -391,12 +391,12 @@ acctproc(int netsock, const char *acctkey, int newacct) break; switch (op) { - case (ACCT_SIGN): + case ACCT_SIGN: if (op_sign(netsock, pkey)) break; warnx("op_sign"); goto out; - case (ACCT_THUMBPRINT): + case ACCT_THUMBPRINT: if (op_thumbprint(netsock, pkey)) break; warnx("op_thumbprint"); diff --git a/usr.sbin/acme-client/json.c b/usr.sbin/acme-client/json.c index da98bd69b2f..1cf68a6e84a 100644 --- a/usr.sbin/acme-client/json.c +++ b/usr.sbin/acme-client/json.c @@ -1,4 +1,4 @@ -/* $Id: json.c,v 1.3 2016/09/01 00:35:22 florian Exp $ */ +/* $Id: json.c,v 1.4 2016/09/13 16:04:51 deraadt Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons * @@ -84,9 +84,9 @@ build(struct parse *parse, struct jsmnn **np, n->type = t->type; switch (t->type) { - case (JSMN_STRING): + case JSMN_STRING: /* FALLTHROUGH */ - case (JSMN_PRIMITIVE): + case JSMN_PRIMITIVE: n->fields = 1; n->d.str = strndup (js + t->start, @@ -94,7 +94,7 @@ build(struct parse *parse, struct jsmnn **np, if (NULL == n->d.str) break; return (1); - case (JSMN_OBJECT): + case JSMN_OBJECT: n->fields = t->size; n->d.obj = calloc(n->fields, sizeof(struct jsmnp)); @@ -117,7 +117,7 @@ build(struct parse *parse, struct jsmnn **np, if (i < (size_t)t->size) break; return (j + 1); - case (JSMN_ARRAY): + case JSMN_ARRAY: n->fields = t->size; n->d.array = calloc(n->fields, sizeof(struct jsmnn *)); diff --git a/usr.sbin/acme-client/main.c b/usr.sbin/acme-client/main.c index 1549ecc9ba4..44a8f4f408b 100644 --- a/usr.sbin/acme-client/main.c +++ b/usr.sbin/acme-client/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.10 2016/09/01 13:47:54 florian Exp $ */ +/* $Id: main.c,v 1.11 2016/09/13 16:04:51 deraadt Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons * @@ -103,48 +103,48 @@ main(int argc, char *argv[]) while (-1 != (c = getopt(argc, argv, "bFmnNrs:tva:f:c:C:k:"))) switch (c) { - case ('a'): + case 'a': agreement = optarg; break; - case ('b'): + case 'b': backup = 1; break; - case ('c'): + case 'c': free(certdir); if (NULL == (certdir = strdup(optarg))) err(EXIT_FAILURE, "strdup"); break; - case ('C'): + case 'C': free(chngdir); if (NULL == (chngdir = strdup(optarg))) err(EXIT_FAILURE, "strdup"); break; - case ('f'): + case 'f': free(acctkey); if (NULL == (acctkey = strdup(optarg))) err(EXIT_FAILURE, "strdup"); break; - case ('F'): + case 'F': force = 1; break; - case ('k'): + case 'k': free(keyfile); if (NULL == (keyfile = strdup(optarg))) err(EXIT_FAILURE, "strdup"); break; - case ('m'): + case 'm': multidir = 1; break; - case ('n'): + case 'n': newacct = 1; break; - case ('N'): + case 'N': newkey = 1; break; - case ('r'): + case 'r': revocate = 1; break; - case ('s'): + case 's': authority = -1; for (i = 0; i < nitems(authorities); i++) { if (strcmp(authorities[i].name, optarg) == 0) { @@ -155,14 +155,14 @@ main(int argc, char *argv[]) if (-1 == authority) errx(EXIT_FAILURE, "unknown acme authority"); break; - case ('t'): + case 't': /* / Undocumented feature. * Don't use it. */ remote = 1; break; - case ('v'): + case 'v': verbose = verbose ? 2 : 1; break; default: -- cgit v1.2.3