[exim-cvs] tidying

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] tidying
Gitweb: https://git.exim.org/exim.git/commitdiff/81a559c80ccd6a0354b5485720c0205a69289fb5
Commit:     81a559c80ccd6a0354b5485720c0205a69289fb5
Parent:     237613d06f9e3b90138bef9f3d9f6401bdd378f3
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Tue Jul 30 22:32:08 2019 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Aug 1 20:49:45 2019 +0100


    tidying
---
 src/src/auths/auth-spa.c  |  2 +-
 src/src/deliver.c         | 16 ++++++----------
 src/src/exim_dbmbuild.c   |  4 ++--
 src/src/mytypes.h         |  8 ++++----
 src/src/store.c           |  2 ++
 src/src/transports/smtp.c |  2 +-
 6 files changed, 16 insertions(+), 18 deletions(-)


diff --git a/src/src/auths/auth-spa.c b/src/src/auths/auth-spa.c
index b396e38..fc363df 100644
--- a/src/src/auths/auth-spa.c
+++ b/src/src/auths/auth-spa.c
@@ -1209,7 +1209,7 @@ char versionString[] = "libntlm version 0.21";

 #define spa_bytes_add(ptr, header, buf, count) \
 { \
-if (buf != NULL  &&  count != 0) /* we hate -Wint-in-bool-contex */ \
+if (buf && (count) != 0) /* we hate -Wint-in-bool-contex */ \
   { \
   SSVAL(&ptr->header.len,0,count); \
   SSVAL(&ptr->header.maxlen,0,count); \
diff --git a/src/src/deliver.c b/src/src/deliver.c
index ba9572e..05494dd 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -6734,7 +6734,7 @@ while (addr_new)           /* Loop until all addresses dealt with */
       (void)post_process_one(addr, DEFER, LOG_MAIN, EXIM_DTYPE_ROUTER, 0);


       /* For remote-retry errors (here and just above) that we've not yet
-      hit the rery time, use the error recorded in the retry database
+      hit the retry time, use the error recorded in the retry database
       as info in the warning message.  This lets us send a message even
       when we're not failing on a fresh attempt.  We assume that this
       info is not sensitive. */
@@ -8284,13 +8284,9 @@ else if (addr_defer != (address_item *)(+1))


         /* List the addresses, with error information if allowed */


-        /* store addr_defer for machine readable part */
-        address_item *addr_dsndefer = addr_defer;
         fputc('\n', f);
-        while (addr_defer)
+    for (address_item * addr = addr_defer; addr; addr = addr->next)
           {
-          address_item *addr = addr_defer;
-          addr_defer = addr->next;
           if (print_address_information(addr, f, US"  ", US"\n    ", US""))
             print_address_error(addr, f, US"Delay reason: ");
           fputc('\n', f);
@@ -8333,16 +8329,16 @@ else if (addr_defer != (address_item *)(+1))
           }
         fputc('\n', f);


-        for ( ; addr_dsndefer; addr_dsndefer = addr_dsndefer->next)
+    for (address_item * addr = addr_defer; addr; addr = addr->next)
           {
       host_item * hu;


-      print_dsn_addr_action(f, addr_dsndefer, US"delayed", US"4.0.0");
+      print_dsn_addr_action(f, addr, US"delayed", US"4.0.0");


-          if ((hu = addr_dsndefer->host_used) && hu->name)
+          if ((hu = addr->host_used) && hu->name)
             {
             fprintf(f, "Remote-MTA: dns; %s\n", hu->name);
-            print_dsn_diagnostic_code(addr_dsndefer, f);
+            print_dsn_diagnostic_code(addr, f);
             }
       fputc('\n', f);
           }
diff --git a/src/src/exim_dbmbuild.c b/src/src/exim_dbmbuild.c
index 542f63c..327b46f 100644
--- a/src/src/exim_dbmbuild.c
+++ b/src/src/exim_dbmbuild.c
@@ -39,14 +39,14 @@ store_get_3(int size, BOOL tainted, const char *filename, int linenumber)
 { return NULL; }
 void **
 store_reset_3(void **ptr, int pool, const char *filename, int linenumber)
-{ }
+{ return NULL; }
 void
 store_release_above_3(void *ptr, const char *func, int linenumber)
 { }
 gstring *
 string_vformat_trc(gstring * g, const uschar * func, unsigned line,
   unsigned size_limit, unsigned flags, const char *format, va_list ap)
-{ }
+{ return NULL; }
 /******************************************************************************/



diff --git a/src/src/mytypes.h b/src/src/mytypes.h
index 37b5a9a..ceb9f1b 100644
--- a/src/src/mytypes.h
+++ b/src/src/mytypes.h
@@ -100,19 +100,19 @@ functions that are called quite often; for other calls to external libraries
 #define Uread(f,b,l)       read(f,CS(b),l)
 #define Urename(s,t)       rename(CCS(s),CCS(t))
 #define Ustat(s,t)         stat(CCS(s),t)
-#define Ustrcat(s,t)       __Ustrcat(s,t, __FUNCTION__, __LINE__)
+#define Ustrcat(s,t)       __Ustrcat(s, CUS(t), __FUNCTION__, __LINE__)
 #define Ustrchr(s,n)       US strchr(CCS(s),n)
 #define CUstrchr(s,n)      CUS strchr(CCS(s),n)
 #define CUstrerror(n)      CUS strerror(n)
 #define Ustrcmp(s,t)       strcmp(CCS(s),CCS(t))
-#define Ustrcpy(s,t)       __Ustrcpy(s,t, __FUNCTION__, __LINE__)
+#define Ustrcpy(s,t)       __Ustrcpy(s, CUS(t), __FUNCTION__, __LINE__)
 #define Ustrcpy_nt(s,t)    strcpy(CS s, CCS t)        /* no taint check */
 #define Ustrcspn(s,t)      strcspn(CCS(s),CCS(t))
 #define Ustrftime(s,m,f,t) strftime(CS(s),m,f,t)
 #define Ustrlen(s)         (int)strlen(CCS(s))
-#define Ustrncat(s,t,n)    __Ustrncat(s,t,n, __FUNCTION__, __LINE__)
+#define Ustrncat(s,t,n)    __Ustrncat(s, CUS(t),n, __FUNCTION__, __LINE__)
 #define Ustrncmp(s,t,n)    strncmp(CCS(s),CCS(t),n)
-#define Ustrncpy(s,t,n)    __Ustrncpy(s,t,n, __FUNCTION__, __LINE__)
+#define Ustrncpy(s,t,n)    __Ustrncpy(s, CUS(t),n, __FUNCTION__, __LINE__)
 #define Ustrncpy_nt(s,t,n) strncpy(CS s, CCS t, n)    /* no taint check */
 #define Ustrpbrk(s,t)      strpbrk(CCS(s),CCS(t))
 #define Ustrrchr(s,n)      US strrchr(CCS(s),n)
diff --git a/src/src/store.c b/src/src/store.c
index 045f27f..9b1a297 100644
--- a/src/src/store.c
+++ b/src/src/store.c
@@ -135,6 +135,7 @@ static int max_pool_malloc;    /* max value for pool_malloc */
 static int max_nonpool_malloc;    /* max value for nonpool_malloc */



+#ifndef COMPILE_UTILITY
 static const uschar * pooluse[NPOOLS] = {
 [POOL_MAIN] =        US"main",
 [POOL_PERM] =        US"perm",
@@ -151,6 +152,7 @@ static const uschar * poolclass[NPOOLS] = {
 [POOL_TAINT_PERM] =    US"tainted",
 [POOL_TAINT_SEARCH] =    US"tainted",
 };
+#endif



static void * store_mmap(int, const char *, int);
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 03243f3..d90f7ad 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -1963,7 +1963,6 @@ smtp_transport_options_block * ob = sx->conn_args.tblock->options_block;
BOOL pass_message = FALSE;
uschar * message = NULL;
int yield = OK;
-int rc;
#ifndef DISABLE_TLS
uschar * tls_errstr;
#endif
@@ -2074,6 +2073,7 @@ if (!continue_hostname)

     if (sx->conn_args.host->dnssec == DS_YES)
       {
+      int rc;
       if(  sx->dane_required
     || verify_check_given_host(CUSS &ob->hosts_try_dane, sx->conn_args.host) == OK
     )