summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2022-02-26 16:40:15 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2022-02-26 16:41:43 +0000
commit973689b1de83eb3dee860a3bb6895e8d5a7b42b2 (patch)
treedb9c7c2de4c7787b51ff6a0eecc9c75315723454 /src
parent990ba85353f824868993d353fda1ede97fd504bf (diff)
tidying
Diffstat (limited to 'src')
-rw-r--r--src/exim_monitor/em_TextPop.c7
-rw-r--r--src/src/dbfn.c8
-rw-r--r--src/src/deliver.c15
-rw-r--r--src/src/lookups/readsock.c2
-rw-r--r--src/src/smtp_in.c2
-rw-r--r--src/src/transports/smtp.c29
6 files changed, 21 insertions, 42 deletions
diff --git a/src/exim_monitor/em_TextPop.c b/src/exim_monitor/em_TextPop.c
index 7e8a2eba1..f8fdefbf3 100644
--- a/src/exim_monitor/em_TextPop.c
+++ b/src/exim_monitor/em_TextPop.c
@@ -246,7 +246,7 @@ Cardinal * num_params;
Arg args[1];
#ifdef notdef
- if (ctx->text.source->Search == NULL) {
+ if (!ctx->text.source->Search) {
XBell(XtDisplay(w), 0);
return;
}
@@ -279,16 +279,15 @@ Cardinal * num_params;
return;
}
- if (ctx->text.search== NULL) {
+ if (!ctx->text.search) {
ctx->text.search = XtNew(struct SearchAndReplace);
ctx->text.search->search_popup = CreateDialog(w, ptr, "search",
AddSearchChildren);
XtRealizeWidget(ctx->text.search->search_popup);
SetWMProtocolTranslations(ctx->text.search->search_popup);
}
- else if (*num_params > 1) {
+ else if (*num_params > 1)
XtVaSetValues(ctx->text.search->search_text, XtNstring, ptr, NULL);
- }
XtSetArg(args[0], XtNeditType,&edit_mode);
XtGetValues(ctx->text.source, args, ONE);
diff --git a/src/src/dbfn.c b/src/src/dbfn.c
index 29cd9e8b9..9c64d6a52 100644
--- a/src/src/dbfn.c
+++ b/src/src/dbfn.c
@@ -49,14 +49,14 @@ at DB release 4.3. */
#if defined(USE_DB) && defined(DB_VERSION_STRING)
void
-#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
+# if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
dbfn_bdb_error_callback(const DB_ENV *dbenv, const char *pfx, const char *msg)
{
dbenv = dbenv;
-#else
+# else
dbfn_bdb_error_callback(const char *pfx, char *msg)
{
-#endif
+# endif
pfx = pfx;
log_write(0, LOG_MAIN, "Berkeley DB error: %s", msg);
}
@@ -286,7 +286,7 @@ store the taint status with the data. */
yield = store_get(EXIM_DATUM_SIZE(result_datum), TRUE);
memcpy(yield, EXIM_DATUM_DATA(result_datum), EXIM_DATUM_SIZE(result_datum));
-if (length != NULL) *length = EXIM_DATUM_SIZE(result_datum);
+if (length) *length = EXIM_DATUM_SIZE(result_datum);
EXIM_DATUM_FREE(result_datum); /* Some DBM libs require freeing */
return yield;
diff --git a/src/src/deliver.c b/src/src/deliver.c
index 8db768dc9..8322a367c 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -5348,10 +5348,10 @@ Returns: nothing
*/
static void
-print_address_error(address_item *addr, FILE *f, uschar *t)
+print_address_error(address_item * addr, FILE * f, const uschar * t)
{
int count = Ustrlen(t);
-uschar *s = testflag(addr, af_pass_message) ? addr->message : NULL;
+uschar * s = testflag(addr, af_pass_message) ? addr->message : NULL;
if (!s && !(s = addr->user_message))
return;
@@ -5892,7 +5892,7 @@ if (message_logs)
return continue_closedown(); /* yields DELIVER_NOT_ATTEMPTED */
}
- /* Make a C stream out of it. */
+ /* Make a stdio stream out of it. */
if (!(message_log = fdopen(fd, "a")))
{
@@ -6420,10 +6420,8 @@ while (addr_new) /* Loop until all addresses dealt with */
while (addr_new)
{
int rc;
- uschar *p;
- tree_node *tnode;
- dbdata_retry *domain_retry_record;
- dbdata_retry *address_retry_record;
+ tree_node * tnode;
+ dbdata_retry * domain_retry_record, * address_retry_record;
addr = addr_new;
addr_new = addr->next;
@@ -6640,8 +6638,7 @@ while (addr_new) /* Loop until all addresses dealt with */
/* Ensure that the domain in the unique field is lower cased, because
domains are always handled caselessly. */
- p = Ustrrchr(addr->unique, '@');
- while (*p != 0) { *p = tolower(*p); p++; }
+ for (uschar * p = Ustrrchr(addr->unique, '@'); *p; p++) *p = tolower(*p);
DEBUG(D_deliver|D_route) debug_printf("unique = %s\n", addr->unique);
diff --git a/src/src/lookups/readsock.c b/src/src/lookups/readsock.c
index 61f729618..44159455d 100644
--- a/src/src/lookups/readsock.c
+++ b/src/src/lookups/readsock.c
@@ -96,7 +96,7 @@ else
sigalrm_seen = FALSE;
ALARM(timeout);
- rc = connect(cctx->sock, (struct sockaddr *)(&sockun), sizeof(sockun));
+ rc = connect(cctx->sock, (struct sockaddr *) &sockun, sizeof(sockun));
ALARM_CLR(0);
if (sigalrm_seen)
{
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index a48fac605..9efc816fa 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -5440,7 +5440,7 @@ while (done <= 0)
ACL may have delayed. To handle cutthrough delivery enforce a dummy call
to get the DATA command sent. */
- if (acl_smtp_predata == NULL && cutthrough.cctx.sock < 0)
+ if (!acl_smtp_predata && cutthrough.cctx.sock < 0)
rc = OK;
else
{
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 2f109a97f..7d5eb35a5 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -2015,44 +2015,31 @@ int yield = OK;
uschar * tls_errstr;
#endif
+/* Many lines of clearing individual elements of *sx that used to
+be here have been replaced by a full memset to zero (de41aff051).
+There are two callers, this file and verify.c . Now we only set
+up nonzero elements. */
+
sx->conn_args.ob = ob;
sx->lmtp = strcmpic(ob->protocol, US"lmtp") == 0;
sx->smtps = strcmpic(ob->protocol, US"smtps") == 0;
-/* sx->ok = FALSE; */
sx->send_rset = TRUE;
sx->send_quit = TRUE;
sx->setting_up = TRUE;
sx->esmtp = TRUE;
-/* sx->esmtp_sent = FALSE; */
-#ifdef SUPPORT_I18N
-/* sx->utf8_needed = FALSE; */
-#endif
sx->dsn_all_lasthop = TRUE;
#ifdef SUPPORT_DANE
-/* sx->conn_args.dane = FALSE; */
sx->dane_required =
verify_check_given_host(CUSS &ob->hosts_require_dane, sx->conn_args.host) == OK;
#endif
-#ifndef DISABLE_PIPE_CONNECT
-/* sx->early_pipe_active = sx->early_pipe_ok = FALSE; */
-/* sx->ehlo_resp.cleartext_features = sx->ehlo_resp.crypted_features = 0; */
-/* sx->pending_BANNER = sx->pending_EHLO = sx->pending_MAIL = FALSE; */
-#endif
if ((sx->max_mail = sx->conn_args.tblock->connection_max_messages) == 0) sx->max_mail = 999999;
if ((sx->max_rcpt = sx->conn_args.tblock->max_addresses) == 0) sx->max_rcpt = 999999;
-/* sx->peer_offered = 0; */
-/* sx->avoid_option = 0; */
sx->igquotstr = US"";
if (!sx->helo_data) sx->helo_data = ob->helo_data;
-#ifdef EXPERIMENTAL_DSN_INFO
-/* sx->smtp_greeting = NULL; */
-/* sx->helo_response = NULL; */
-#endif
smtp_command = US"initial connection";
-/* sx->buffer[0] = '\0'; */
/* Set up the buffer for reading SMTP response packets. */
@@ -2066,9 +2053,6 @@ sx->inblock.ptrend = sx->inbuffer;
sx->outblock.buffer = sx->outbuffer;
sx->outblock.buffersize = sizeof(sx->outbuffer);
sx->outblock.ptr = sx->outbuffer;
-/* sx->outblock.cmd_count = 0; */
-/* sx->outblock.authenticating = FALSE; */
-/* sx->outblock.conn_args = NULL; */
/* Reset the parameters of a TLS session. */
@@ -3716,12 +3700,11 @@ BOOL tcw_done = FALSE, tcw = FALSE;
memset(sx, 0, sizeof(*sx));
sx->addrlist = addrlist;
sx->conn_args.host = host;
-sx->conn_args.host_af = host_af,
+sx->conn_args.host_af = host_af;
sx->port = defport;
sx->conn_args.interface = interface;
sx->helo_data = NULL;
sx->conn_args.tblock = tblock;
-/* sx->verify = FALSE; */
gettimeofday(&sx->delivery_start, NULL);
sx->sync_addr = sx->first_addr = addrlist;