From a821613b105f7610fd0690a94934e0a15f608465 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 20 Apr 2022 15:31:48 +0000 Subject: [PATCH] Fix various annoying whitespace errors. --- usr.sbin/rpki-client/encoding.c | 3 +-- usr.sbin/rpki-client/http.c | 20 ++++++++++---------- usr.sbin/rpki-client/io.c | 4 ++-- usr.sbin/rpki-client/output-bird.c | 4 ++-- usr.sbin/rpki-client/print.c | 11 +++++------ usr.sbin/rpki-client/repo.c | 6 +++--- usr.sbin/rpki-client/rsync.c | 4 ++-- 7 files changed, 25 insertions(+), 27 deletions(-) diff --git a/usr.sbin/rpki-client/encoding.c b/usr.sbin/rpki-client/encoding.c index 1fed80d0d92..023dd682ccf 100644 --- a/usr.sbin/rpki-client/encoding.c +++ b/usr.sbin/rpki-client/encoding.c @@ -1,4 +1,4 @@ -/* $OpenBSD: encoding.c,v 1.11 2022/04/19 19:01:19 claudio Exp $ */ +/* $OpenBSD: encoding.c,v 1.12 2022/04/20 15:31:48 tb Exp $ */ /* * Copyright (c) 2020 Claudio Jeker * @@ -226,4 +226,3 @@ hex_decode(const char *hexstr, char *buf, size_t len) } return 0; } - diff --git a/usr.sbin/rpki-client/http.c b/usr.sbin/rpki-client/http.c index d230e7ba999..be33c2265db 100644 --- a/usr.sbin/rpki-client/http.c +++ b/usr.sbin/rpki-client/http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: http.c,v 1.55 2022/04/11 18:59:23 claudio Exp $ */ +/* $OpenBSD: http.c,v 1.56 2022/04/20 15:31:48 tb Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2020 Claudio Jeker @@ -436,7 +436,7 @@ http_parse_uri(char *uri, char **ohost, char **oport, char **opath) warnx("%s: preposterous host length", http_info(uri)); return -1; } - + if (memchr(host, '@', path - host) != NULL) { warnx("%s: URI with userinfo not supported", http_info(uri)); return -1; @@ -633,7 +633,7 @@ http_req_schedule(struct http_request *req) /* * Create a new HTTP connection which will be used for the HTTP request req. * On errors a req faulure is issued and both connection and request are freed. - */ + */ static void http_new(struct http_request *req) { @@ -803,7 +803,7 @@ http_connect(struct http_connection *conn) { const char *cause = NULL; - assert(conn->fd == -1); + assert(conn->fd == -1); conn->state = STATE_CONNECT; /* start the loop below with first or next address */ @@ -1140,7 +1140,7 @@ http_redirect(struct http_connection *conn) logx("redirect to %s", http_info(uri)); http_req_new(conn->req->id, uri, mod_since, conn->req->redirect_loop, - outfd); + outfd); /* clear request before moving connection to idle */ http_req_free(conn->req); @@ -1244,7 +1244,7 @@ http_parse_header(struct http_connection *conn, char *buf) * The line returned has any possible '\r' and '\n' at the end stripped. * The buffer is advanced to the start of the next line. * If there is currently no full line in the buffer NULL is returned. - */ + */ static char * http_get_line(struct http_connection *conn) { @@ -1407,7 +1407,7 @@ again: } else if (conn->status == 304) { return http_done(conn, HTTP_NOT_MOD); } - + return http_failed(conn); case STATE_RESPONSE_DATA: if (conn->bufpos != conn->bufsz && @@ -1759,7 +1759,7 @@ http_setup(void) err(1, "tls_load_file: %s", tls_default_ca_cert_file()); tls_config_set_ca_mem(tls_config, tls_ca_mem, tls_ca_size); - if ((httpproxy = getenv("http_proxy")) != NULL && *httpproxy == '\0') + if ((httpproxy = getenv("http_proxy")) != NULL && *httpproxy == '\0') httpproxy = NULL; proxy_parse_uri(httpproxy); @@ -1821,7 +1821,7 @@ proc_http(char *bind_addr, int fd) if (conn->io_time <= now) timeout = 0; else { - int diff = conn->io_time - now; + int diff = conn->io_time - now; diff *= 1000; if (timeout == INFTIM || diff < timeout) timeout = diff; @@ -1842,7 +1842,7 @@ proc_http(char *bind_addr, int fd) if (conn->idle_time <= now) timeout = 0; else { - int diff = conn->idle_time - now; + int diff = conn->idle_time - now; diff *= 1000; if (timeout == INFTIM || diff < timeout) timeout = diff; diff --git a/usr.sbin/rpki-client/io.c b/usr.sbin/rpki-client/io.c index 78c6b7de6d9..f9541c57e34 100644 --- a/usr.sbin/rpki-client/io.c +++ b/usr.sbin/rpki-client/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.18 2021/12/05 12:26:27 jsg Exp $ */ +/* $OpenBSD: io.c,v 1.19 2022/04/20 15:31:48 tb Exp $ */ /* * Copyright (c) 2021 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -247,7 +247,7 @@ io_buf_recvfd(int fd, struct ibuf **ib) if ((b = ibuf_dynamic(sizeof(sz), INT32_MAX)) == NULL) err(1, NULL); *ib = b; - + memset(&msg, 0, sizeof(msg)); memset(&cmsgbuf, 0, sizeof(cmsgbuf)); diff --git a/usr.sbin/rpki-client/output-bird.c b/usr.sbin/rpki-client/output-bird.c index a82c49fa801..eb0c98aa405 100644 --- a/usr.sbin/rpki-client/output-bird.c +++ b/usr.sbin/rpki-client/output-bird.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output-bird.c,v 1.12 2021/10/11 16:50:03 job Exp $ */ +/* $OpenBSD: output-bird.c,v 1.13 2022/04/20 15:31:48 tb Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2020 Robert Scheck @@ -64,7 +64,7 @@ output_bird1v6(FILE *out, struct vrp_tree *vrps, struct brk_tree *brks, RB_FOREACH(v, vrp_tree, vrps) { char buf[64]; - + if (v->afi == AFI_IPV6) { ip_addr_print(&v->addr, v->afi, buf, sizeof(buf)); if (fprintf(out, "\troa %s max %u as %u;\n", buf, diff --git a/usr.sbin/rpki-client/print.c b/usr.sbin/rpki-client/print.c index 89bb4bbc9ea..5b88a21dbc7 100644 --- a/usr.sbin/rpki-client/print.c +++ b/usr.sbin/rpki-client/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.8 2022/04/20 10:46:20 job Exp $ */ +/* $OpenBSD: print.c,v 1.9 2022/04/20 15:31:48 tb Exp $ */ /* * Copyright (c) 2021 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -101,7 +101,6 @@ tal_print(const struct tal *p) printf(", "); } printf("]\n"); - } else { printf("Trust anchor name: %s\n", p->descr); printf("Subject key identifier: %s\n", pretty_key_id(ski)); @@ -109,7 +108,7 @@ tal_print(const struct tal *p) for (i = 0; i < p->urisz; i++) printf("%5zu: %s\n", i + 1, p->uri[i]); } - + EVP_PKEY_free(pk); free(rder); free(ski); @@ -131,9 +130,9 @@ x509_print(const X509 *x) if (serial == NULL) { warnx("x509_convert_seqnum failed in %s", __func__); goto out; - } + } - if (outformats & FORMAT_JSON) { + if (outformats & FORMAT_JSON) { printf("\t\"cert_serial\": \"%s\",\n", serial); } else { printf("Certificate serial: %s\n", serial); @@ -293,7 +292,7 @@ crl_print(const struct crl *p) printf("\t\"valid_since\": %lld,\n", (long long)p->issued); printf("\t\"valid_until\": %lld,\n", (long long)p->expires); printf("\t\"revoked_certs\": [\n"); - } else { + } else { printf("CRL valid since: %s\n", time2str(p->issued)); printf("CRL valid until: %s\n", time2str(p->expires)); printf("Revoked Certificates:\n"); diff --git a/usr.sbin/rpki-client/repo.c b/usr.sbin/rpki-client/repo.c index 323dcf7857d..ded44d53c82 100644 --- a/usr.sbin/rpki-client/repo.c +++ b/usr.sbin/rpki-client/repo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: repo.c,v 1.32 2022/04/04 16:02:54 claudio Exp $ */ +/* $OpenBSD: repo.c,v 1.33 2022/04/20 15:31:48 tb Exp $ */ /* * Copyright (c) 2021 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -1243,7 +1243,7 @@ repo_cleanup_rrdp(struct filepath_tree *tree) struct rrdprepo *rr; struct filepath *fp, *nfp; char *fn; - + SLIST_FOREACH(rr, &rrdprepos, entry) { RB_FOREACH_SAFE(fp, filepath_tree, &rr->deleted, nfp) { if (!rrdp_uri_valid(rr, fp->file)) { @@ -1366,7 +1366,7 @@ repo_cleanup(struct filepath_tree *tree, int cachefd) /* first move temp files which have been used to valid dir */ repo_move_valid(tree); - /* then delete files requested by rrdp */ + /* then delete files requested by rrdp */ repo_cleanup_rrdp(tree); if ((fts = fts_open(argv, FTS_PHYSICAL | FTS_NOSTAT, NULL)) == NULL) diff --git a/usr.sbin/rpki-client/rsync.c b/usr.sbin/rpki-client/rsync.c index e78891ba365..3c1149271ba 100644 --- a/usr.sbin/rpki-client/rsync.c +++ b/usr.sbin/rpki-client/rsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsync.c,v 1.35 2022/04/11 18:59:23 claudio Exp $ */ +/* $OpenBSD: rsync.c,v 1.36 2022/04/20 15:31:48 tb Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -44,7 +44,7 @@ struct rsyncproc { char *uri; /* uri of this rsync proc */ unsigned int id; /* identity of request */ - pid_t pid; /* pid of process or 0 if unassociated */ + pid_t pid; /* pid of process or 0 if unassociated */ }; /* -- 2.20.1