tidying
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 26 Nov 2017 15:20:04 +0000 (15:20 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 26 Nov 2017 16:21:05 +0000 (16:21 +0000)
src/src/daemon.c
src/src/dkim.c
src/src/malware.c
src/src/pdkim/pdkim.c
src/src/receive.c
src/src/sieve.c
src/src/spam.c
src/src/transports/pipe.c

index 7d55287858d067e87f9129f1d4d56a7c95855f1b..37fefd4b1d96566401f2087825f117c539b670ef 100644 (file)
@@ -144,8 +144,7 @@ EXIM_SOCKLEN_T ifsize = sizeof(interface_sockaddr);
 int dup_accept_socket = -1;
 int max_for_this_host = 0;
 int save_log_selector = *log_selector;
 int dup_accept_socket = -1;
 int max_for_this_host = 0;
 int save_log_selector = *log_selector;
-gstring * whofrom = NULL;
-uschar * whofrom_s;
+gstring * whofrom;
 
 void *reset_point = store_get(0);
 
 
 void *reset_point = store_get(0);
 
@@ -200,7 +199,7 @@ DEBUG(D_interface) debug_printf("interface address=%s port=%d\n",
 the local interface data. This is for logging; at the end of this function the
 memory is reclaimed. */
 
 the local interface data. This is for logging; at the end of this function the
 memory is reclaimed. */
 
-whofrom = string_append(whofrom, 3, "[", sender_host_address, "]");
+whofrom = string_append(NULL, 3, "[", sender_host_address, "]");
 
 if (LOGGING(incoming_port))
   whofrom = string_append(whofrom, 2, ":", string_sprintf("%d", sender_host_port));
 
 if (LOGGING(incoming_port))
   whofrom = string_append(whofrom, 2, ":", string_sprintf("%d", sender_host_port));
index 6bc711ac14101460e80548571615a16418cfb224..5e97c1b79cbea1081635698c570014f77e7cfc89 100644 (file)
@@ -685,7 +685,7 @@ while ((dkim_signing_domain = string_nextinlist(&dkim_domain, &sep, NULL, 0)))
 
     pdkim_set_optional(sig,
                        CS dkim_sign_headers_expanded,
 
     pdkim_set_optional(sig,
                        CS dkim_sign_headers_expanded,
-                       dkim_identity_expanded,
+                       CS dkim_identity_expanded,
                        pdkim_canon,
                        pdkim_canon, -1, 0, 0);
 
                        pdkim_canon,
                        pdkim_canon, -1, 0, 0);
 
index 9a98c99578c1b499c79d79fd77096ae3063eb9b6..7ae8200ae952b468c085b7ff5695692f9e2fc07f 100644 (file)
@@ -747,7 +747,7 @@ badseek:  err = errno;
            pcre_get_substring(CS tmpbuf, ovector, result, 1, &pre_malware_nb);
 
            if (i==0)   /* the first name we just copy to malware_name */
            pcre_get_substring(CS tmpbuf, ovector, result, 1, &pre_malware_nb);
 
            if (i==0)   /* the first name we just copy to malware_name */
-             g = string_cat(NULL, pre_malware_nb);
+             g = string_cat(NULL, US pre_malware_nb);
 
            /*XXX could be string_append_listele? */
            else        /* concatenate each new virus name to previous */
 
            /*XXX could be string_append_listele? */
            else        /* concatenate each new virus name to previous */
@@ -1239,7 +1239,6 @@ badseek:  err = errno;
 
       uschar *p, *vname, *result_tag;
       int bread=0;
 
       uschar *p, *vname, *result_tag;
       int bread=0;
-      uschar * file_name;
       uschar av_buffer[1024];
       uschar *hostname = US"";
       host_item connhost;
       uschar av_buffer[1024];
       uschar *hostname = US"";
       host_item connhost;
index 1388618151ad2d5eca653a0827de1d9994c7c0fd..53b304d0d6d900af180acd93fac017d13f7ed46f 100644 (file)
@@ -224,7 +224,7 @@ static void
 pdkim_strtrim(gstring * str)
 {
 uschar * p = str->s;
 pdkim_strtrim(gstring * str)
 {
 uschar * p = str->s;
-uschar * q = p + str->ptr;
+uschar * q;
 
 while (*p == '\t' || *p == ' ')                /* dump the leading whitespace */
   { str->size--; str->ptr--; str->s++; }
 
 while (*p == '\t' || *p == ' ')                /* dump the leading whitespace */
   { str->size--; str->ptr--; str->s++; }
index d9b500102af6cad10275713fdbd4b34a5c22d22b..cdb575825a930c8589a05f9f531711475e1d2f19 100644 (file)
@@ -3443,7 +3443,7 @@ else
              continue;
              }
 
              continue;
              }
 
-           seen_items = string_catn(seen_items, ":", 1);
+           seen_items = string_catn(seen_items, US":", 1);
            }
          seen_items = string_cat(seen_items, item);
 
            }
          seen_items = string_cat(seen_items, item);
 
@@ -3775,29 +3775,29 @@ else
   switch(rc)
     {
     default:
   switch(rc)
     {
     default:
-    log_write(0, LOG_MAIN, "invalid return %d from local_scan(). Temporary "
-      "rejection given", rc);
-    goto TEMPREJECT;
+      log_write(0, LOG_MAIN, "invalid return %d from local_scan(). Temporary "
+       "rejection given", rc);
+      goto TEMPREJECT;
 
     case LOCAL_SCAN_REJECT_NOLOGHDR:
 
     case LOCAL_SCAN_REJECT_NOLOGHDR:
-    BIT_CLEAR(log_selector, log_selector_size, Li_rejected_header);
-    /* Fall through */
+      BIT_CLEAR(log_selector, log_selector_size, Li_rejected_header);
+      /* Fall through */
 
     case LOCAL_SCAN_REJECT:
 
     case LOCAL_SCAN_REJECT:
-    smtp_code = US"550";
-    if (errmsg == NULL) errmsg =  US"Administrative prohibition";
-    break;
+      smtp_code = US"550";
+      if (!errmsg) errmsg =  US"Administrative prohibition";
+      break;
 
     case LOCAL_SCAN_TEMPREJECT_NOLOGHDR:
 
     case LOCAL_SCAN_TEMPREJECT_NOLOGHDR:
-    BIT_CLEAR(log_selector, log_selector_size, Li_rejected_header);
-    /* Fall through */
+      BIT_CLEAR(log_selector, log_selector_size, Li_rejected_header);
+      /* Fall through */
 
     case LOCAL_SCAN_TEMPREJECT:
     TEMPREJECT:
 
     case LOCAL_SCAN_TEMPREJECT:
     TEMPREJECT:
-    smtp_code = US"451";
-    if (errmsg == NULL) errmsg = US"Temporary local problem";
-    istemp = US"temporarily ";
-    break;
+      smtp_code = US"451";
+      if (!errmsg) errmsg = US"Temporary local problem";
+      istemp = US"temporarily ";
+      break;
     }
 
   g = string_append(g, 2, US"F=",
     }
 
   g = string_append(g, 2, US"F=",
index f4ce58402f5e7f7a32e39bd93dff6b24c7f54316..2373cfb8e7b49e8288954e0856d2c758cbc91802 100644 (file)
@@ -1472,10 +1472,10 @@ Returns:      1                success
               0                identifier not matched
 */
 
               0                identifier not matched
 */
 
-static int parse_string(struct Sieve *filter, struct String *data)
+static int
+parse_string(struct Sieve *filter, struct String *data)
 {
 gstring * g = NULL;
 {
 gstring * g = NULL;
-int dataCapacity=0;
 
 data->length = 0;
 data->character = NULL;
 
 data->length = 0;
 data->character = NULL;
@@ -1737,7 +1737,6 @@ if (*filter->pc=='[') /* string list */
     if (dataLength+1 >= dataCapacity) /* increase buffer */
       {
       struct String *new;
     if (dataLength+1 >= dataCapacity) /* increase buffer */
       {
       struct String *new;
-      int newCapacity;          /* Don't amalgamate with next line; some compilers grumble */
 
       dataCapacity = dataCapacity ? dataCapacity * 2 : 4;
       new = store_get(sizeof(struct String) * dataCapacity);
 
       dataCapacity = dataCapacity ? dataCapacity * 2 : 4;
       new = store_get(sizeof(struct String) * dataCapacity);
@@ -3286,7 +3285,6 @@ while (*filter->pc)
     if (exec)
       {
       address_item *addr;
     if (exec)
       {
       address_item *addr;
-      int start;
       uschar *buffer;
       int buffer_capacity;
       md5 base;
       uschar *buffer;
       int buffer_capacity;
       md5 base;
@@ -3384,8 +3382,8 @@ while (*filter->pc)
 
             for
               (
 
             for
               (
-              mime_body=reason.character,reason_end=reason.character+reason.length;
-              mime_body<(reason_end-(sizeof(nlnl)-1)) && memcmp(mime_body,nlnl,(sizeof(nlnl)-1));
+              mime_body = reason.character, reason_end = reason.character + reason.length;
+              mime_body < (reason_end-(sizeof(nlnl)-1)) && memcmp(mime_body, nlnl, (sizeof(nlnl)-1));
               ++mime_body
               );
 
               ++mime_body
               );
 
@@ -3399,7 +3397,6 @@ while (*filter->pc)
             {
             struct String qp = { .character = NULL, .length = 0 };  /* Keep compiler happy (PH) */
 
             {
             struct String qp = { .character = NULL, .length = 0 };  /* Keep compiler happy (PH) */
 
-            start = reason.length;
             addr->reply->headers = US"MIME-Version: 1.0\n"
                                    "Content-Type: text/plain;\n"
                                    "\tcharset=\"utf-8\"\n"
             addr->reply->headers = US"MIME-Version: 1.0\n"
                                    "Content-Type: text/plain;\n"
                                    "\tcharset=\"utf-8\"\n"
index 6b03a848fe207535fcb44b67f3b5466db9a32a2f..b05f2d7089d3a0a2df4158ef3f2133cb7b39bc6e 100644 (file)
@@ -391,7 +391,7 @@ if (sd->is_rspamd)
     req_str = string_append(req_str, 3, "IP: ", sender_host_address, "\r\n");
   if ((s = expand_string(US"$authenticated_id")) && *s)
     req_str = string_append(req_str, 3, "User: ", s, "\r\n");
     req_str = string_append(req_str, 3, "IP: ", sender_host_address, "\r\n");
   if ((s = expand_string(US"$authenticated_id")) && *s)
     req_str = string_append(req_str, 3, "User: ", s, "\r\n");
-  req_str = string_catn(req_str, "\r\n", 2);
+  req_str = string_catn(req_str, US"\r\n", 2);
   wrote = send(spamd_sock, req_str->s, req_str->ptr, 0);
   }
 else
   wrote = send(spamd_sock, req_str->s, req_str->ptr, 0);
   }
 else
index 5b7fa1f5cd0b52c9ab04a9abed3ae42f89dc2a6c..0361cc816277893d29b9b71ff1b1b18d7c074571 100644 (file)
@@ -473,8 +473,7 @@ $pipe_addresses, which is not recognized by the normal expansion function. */
 
 if (expand_arguments)
   {
 
 if (expand_arguments)
   {
-  uschar *s = cmd;
-  uschar *p = Ustrstr(cmd, "pipe_addresses");
+  uschar * p = Ustrstr(cmd, "pipe_addresses");
   gstring * g = NULL;
 
   DEBUG(D_transport)
   gstring * g = NULL;
 
   DEBUG(D_transport)