From fbe8578a39505c146223ffcf2c63a5ba8bb0d9a4 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Fri, 25 Jun 2021 15:23:38 +0100 Subject: [PATCH] tidying --- src/src/acl.c | 4 ++-- src/src/dkim.c | 17 +++++------------ src/src/host.c | 2 +- src/src/smtp_in.c | 4 ++-- src/src/tls-openssl.c | 8 ++++---- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/src/acl.c b/src/src/acl.c index 89947f405..f47259ca0 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -3540,7 +3540,7 @@ for (; cb; cb = cb->next) } break; - #ifndef DISABLE_DKIM +#ifndef DISABLE_DKIM case ACLC_DKIM_SIGNER: if (dkim_cur_signer) rc = match_isinlist(dkim_cur_signer, @@ -3553,7 +3553,7 @@ for (; cb; cb = cb->next) rc = match_isinlist(dkim_verify_status, &arg, 0, NULL, NULL, MCL_STRING, TRUE, NULL); break; - #endif +#endif #ifdef SUPPORT_DMARC case ACLC_DMARC_STATUS: diff --git a/src/src/dkim.c b/src/src/dkim.c index 87c9c9197..63b0ba62c 100644 --- a/src/src/dkim.c +++ b/src/src/dkim.c @@ -54,10 +54,7 @@ gstring * g = string_get_tainted(256, TRUE); lookup_dnssec_authenticated = NULL; if (dns_lookup(dnsa, name, T_TXT, NULL) != DNS_SUCCEED) - { - store_free_dns_answer(dnsa); - return NULL; /*XXX better error detail? logging? */ - } + goto bad; /* Search for TXT record */ @@ -65,12 +62,8 @@ for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); rr; rr = dns_next_rr(dnsa, &dnss, RESET_NEXT)) if (rr->type == T_TXT) - { - int rr_offset = 0; - - /* Copy record content to the answer buffer */ - - while (rr_offset < rr->size) + { /* Copy record content to the answer buffer */ + for (int rr_offset = 0; rr_offset < rr->size; ) { uschar len = rr->data[rr_offset++]; @@ -81,7 +74,7 @@ for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); rr_offset += len; } - /* check if this looks like a DKIM record */ + /* Check if this looks like a DKIM record */ if (Ustrncmp(g->s, "v=", 2) != 0 || strncasecmp(CS g->s, "v=dkim", 6) == 0) { store_free_dns_answer(dnsa); @@ -89,7 +82,7 @@ for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); return string_from_gstring(g); } - if (g) g->ptr = 0; /* overwrite previous record */ + g->ptr = 0; /* overwrite previous record */ } bad: diff --git a/src/src/host.c b/src/src/host.c index e11931b60..c2ea770e2 100644 --- a/src/src/host.c +++ b/src/src/host.c @@ -1794,7 +1794,7 @@ HDEBUG(D_host_lookup) { uschar **aliases = sender_host_aliases; debug_printf("IP address lookup yielded \"%s\"\n", sender_host_name); - while (*aliases != NULL) debug_printf(" alias \"%s\"\n", *aliases++); + while (*aliases) debug_printf(" alias \"%s\"\n", *aliases++); } /* We need to verify that a forward lookup on the name we found does indeed diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 78c86e7c9..ee248c517 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -3195,7 +3195,7 @@ which sometimes uses smtp_printf() and sometimes smtp_respond(). */ if (fl.rcpt_in_progress) { - if (rcpt_smtp_response == NULL) + if (!rcpt_smtp_response) rcpt_smtp_response = string_copy(msg); else if (fl.rcpt_smtp_response_same && Ustrcmp(rcpt_smtp_response, msg) != 0) @@ -3210,7 +3210,7 @@ not the whole MAIL/RCPT/DATA response set. */ for (;;) { uschar *nl = Ustrchr(msg, '\n'); - if (nl == NULL) + if (!nl) { smtp_printf("%.3s%c%.*s%s\r\n", !final, code, final ? ' ':'-', esclen, esc, msg); return; diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index 4636f3c32..d99de53d6 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -228,12 +228,12 @@ static exim_openssl_option exim_openssl_options[] = { { US"no_tlsv1", SSL_OP_NO_TLSv1 }, #endif #ifdef SSL_OP_NO_TLSv1_1 -#if SSL_OP_NO_TLSv1_1 == 0x00000400L +# if SSL_OP_NO_TLSv1_1 == 0x00000400L /* Error in chosen value in 1.0.1a; see first item in CHANGES for 1.0.1b */ -#warning OpenSSL 1.0.1a uses a bad value for SSL_OP_NO_TLSv1_1, ignoring -#else +# warning OpenSSL 1.0.1a uses a bad value for SSL_OP_NO_TLSv1_1, ignoring +# else { US"no_tlsv1_1", SSL_OP_NO_TLSv1_1 }, -#endif +# endif #endif #ifdef SSL_OP_NO_TLSv1_2 { US"no_tlsv1_2", SSL_OP_NO_TLSv1_2 }, -- 2.30.2