tidying
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 15 Jan 2023 22:08:48 +0000 (22:08 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 15 Jan 2023 22:08:48 +0000 (22:08 +0000)
src/src/expand.c
src/src/filter.c
src/src/priv.c
src/src/regex_cache.c
src/src/spool_in.c
src/src/tls.c

index 62b4a189050c8c9a81ab7e93dcb81626635b5035..2949579c5ac3192bcd4a60ffe6100dcb2c2edbc1 100644 (file)
@@ -23,16 +23,18 @@ typedef unsigned esi_flags;
 #define ESI_HONOR_DOLLAR       BIT(1)  /* $ is meaningfull */
 #define ESI_SKIPPING           BIT(2)  /* value will not be needed */
 
+#ifdef STAND_ALONE
+# ifndef SUPPORT_CRYPTEQ
+#  define SUPPORT_CRYPTEQ
+# endif
+#else
+
 /* Recursively called function */
 
 static uschar *expand_string_internal(const uschar *, esi_flags, const uschar **, BOOL *, BOOL *);
 static int_eximarith_t expanded_string_integer(const uschar *, BOOL);
 
-#ifdef STAND_ALONE
-# ifndef SUPPORT_CRYPTEQ
-#  define SUPPORT_CRYPTEQ
-# endif
-#endif
+#endif /*!STAND_ALONE*/
 
 #ifdef LOOKUP_LDAP
 # include "lookups/ldap.h"
@@ -835,8 +837,6 @@ static var_entry var_table[] = {
   { "warnmsg_recipients",  vtype_stringptr,   &warnmsg_recipients }
 };
 
-static int var_table_size = nelem(var_table);
-
 #ifdef MACRO_PREDEF
 
 /* dummies */
@@ -1278,7 +1278,7 @@ static var_entry *
 find_var_ent(uschar * name)
 {
 int first = 0;
-int last = var_table_size;
+int last = nelem(var_table);
 
 while (last > first)
   {
@@ -8806,7 +8806,7 @@ for (int i = 0; i < REGEX_VARS; i++) if (regex_vars[i])
 #endif
 
 /* check known-name variables */
-for (var_entry * v = var_table; v < var_table + var_table_size; v++)
+for (var_entry * v = var_table; v < var_table + nelem(var_table); v++)
   if (v->type == vtype_stringptr)
     assert_variable_notin(US v->name, *(USS v->value), &e);
 
index 530d772b37eeca241f689e30ae72f8e315c0c05c..d878acb8ff407b16988f1c95d9373833e4bfdbb1 100644 (file)
@@ -671,8 +671,8 @@ for (;;)
       {
 //      if (toplevel) *saveptr = 0;
 //      else
-   if (!toplevel)
-      *error_pointer = string_sprintf("missing \")\" at end of "
+      if (!toplevel)
+        *error_pointer = string_sprintf("missing \")\" at end of "
           "condition near line %d of filter file", line_number);
       break;
       }
index 3a100cd9e671b14c93c47fb6515bc3432d6ad842..9305f8b459ad1f066cd2fecf73ff39dc32e09791 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c)  The Exim Maintainers 2022 *
+/* Copyright (c)  The Exim Maintainers 2022 */
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
 #include "exim.h"
index a9b482174a38e8494fb531ea3aeef2ad5ae40b31..1ca3c96d5811c5d755d24dcd3dacc8a59a90d18e 100644 (file)
@@ -239,7 +239,7 @@ regex_at_daemon(const uschar * reqbuf)
 {
 const re_req * req = (const re_req *)reqbuf;
 uschar * errstr;
-const pcre2_code * cre;
+const pcre2_code * cre = NULL;
 
 if (regex_cachesize >= REGEX_CACHESIZE_LIMIT)
   errstr = US"regex cache size limit reached";
index e785f695bcd06361539725d4b40982014f0cbb21..1291197de42a5cdf3eae0ca7b44c3fc8bcff1068 100644 (file)
@@ -496,15 +496,18 @@ for (;;)
   if (*var == '(')                             /* marker for quoted value */
     {
     uschar * s;
-    int idx;
     for (s = ++var; *s != ')'; ) s++;
 #ifndef COMPILE_UTILITY
-    if ((idx = search_findtype(var, s - var)) < 0)
       {
-      DEBUG(D_any) debug_printf("Unrecognised quoter %.*s\n", (int)(s - var), var+1);
-      goto SPOOL_FORMAT_ERROR;
+      int idx;
+      if ((idx = search_findtype(var, s - var)) < 0)
+       {
+       DEBUG(D_any)
+         debug_printf("Unrecognised quoter %.*s\n", (int)(s - var), var+1);
+       goto SPOOL_FORMAT_ERROR;
+       }
+      proto_mem = store_get_quoted(1, GET_TAINTED, idx);
       }
-    proto_mem = store_get_quoted(1, GET_TAINTED, idx);
 #endif  /* COMPILE_UTILITY */
     var = s + 1;
     }
index f7be5293ded2175f7214515cc4521671db312976..ba7c2de38c318f5a2a203c6727c7b0b487df253c 100644 (file)
@@ -26,11 +26,6 @@ functions from the OpenSSL or GNU TLS libraries. */
 #endif
 
 
-/* Forward decl. */
-static void tls_client_resmption_key(tls_support *, smtp_connect_args *,
-  smtp_transport_options_block *);
-
-
 #if defined(MACRO_PREDEF) && !defined(DISABLE_TLS)
 # include "macro_predef.h"
 # ifdef USE_GNUTLS
@@ -459,6 +454,10 @@ tzset();
 /*************************************************
 *        Many functions are package-specific     *
 *************************************************/
+/* Forward decl. */
+static void tls_client_resmption_key(tls_support *, smtp_connect_args *,
+  smtp_transport_options_block *);
+
 
 #ifdef USE_GNUTLS
 # include "tls-gnu.c"