summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2017-11-26 15:20:04 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2017-11-26 16:21:05 +0000
commitb2bcdd35f0923e96b717d035e9d991b50a38eb50 (patch)
treebfd19154dfb3278d07e5dfca3fcfd534196d1001
parent625667b6b6463db6344b5f10eb9dbf01e231573e (diff)
tidying
-rw-r--r--src/src/daemon.c5
-rw-r--r--src/src/dkim.c2
-rw-r--r--src/src/malware.c3
-rw-r--r--src/src/pdkim/pdkim.c2
-rw-r--r--src/src/receive.c30
-rw-r--r--src/src/sieve.c11
-rw-r--r--src/src/spam.c2
-rw-r--r--src/src/transports/pipe.c3
8 files changed, 26 insertions, 32 deletions
diff --git a/src/src/daemon.c b/src/src/daemon.c
index 7d5528785..37fefd4b1 100644
--- a/src/src/daemon.c
+++ b/src/src/daemon.c
@@ -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;
-gstring * whofrom = NULL;
-uschar * whofrom_s;
+gstring * whofrom;
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. */
-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));
diff --git a/src/src/dkim.c b/src/src/dkim.c
index 6bc711ac1..5e97c1b79 100644
--- a/src/src/dkim.c
+++ b/src/src/dkim.c
@@ -685,7 +685,7 @@ while ((dkim_signing_domain = string_nextinlist(&dkim_domain, &sep, NULL, 0)))
pdkim_set_optional(sig,
CS dkim_sign_headers_expanded,
- dkim_identity_expanded,
+ CS dkim_identity_expanded,
pdkim_canon,
pdkim_canon, -1, 0, 0);
diff --git a/src/src/malware.c b/src/src/malware.c
index 9a98c9957..7ae8200ae 100644
--- a/src/src/malware.c
+++ b/src/src/malware.c
@@ -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 */
- 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 */
@@ -1239,7 +1239,6 @@ badseek: err = errno;
uschar *p, *vname, *result_tag;
int bread=0;
- uschar * file_name;
uschar av_buffer[1024];
uschar *hostname = US"";
host_item connhost;
diff --git a/src/src/pdkim/pdkim.c b/src/src/pdkim/pdkim.c
index 138861815..53b304d0d 100644
--- a/src/src/pdkim/pdkim.c
+++ b/src/src/pdkim/pdkim.c
@@ -224,7 +224,7 @@ static void
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++; }
diff --git a/src/src/receive.c b/src/src/receive.c
index d9b500102..cdb575825 100644
--- a/src/src/receive.c
+++ b/src/src/receive.c
@@ -3443,7 +3443,7 @@ else
continue;
}
- seen_items = string_catn(seen_items, ":", 1);
+ seen_items = string_catn(seen_items, US":", 1);
}
seen_items = string_cat(seen_items, item);
@@ -3775,29 +3775,29 @@ else
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:
- 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:
- 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:
- 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:
- 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=",
diff --git a/src/src/sieve.c b/src/src/sieve.c
index f4ce58402..2373cfb8e 100644
--- a/src/src/sieve.c
+++ b/src/src/sieve.c
@@ -1472,10 +1472,10 @@ Returns: 1 success
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;
-int dataCapacity=0;
data->length = 0;
data->character = NULL;
@@ -1737,7 +1737,6 @@ if (*filter->pc=='[') /* string list */
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);
@@ -3286,7 +3285,6 @@ while (*filter->pc)
if (exec)
{
address_item *addr;
- int start;
uschar *buffer;
int buffer_capacity;
md5 base;
@@ -3384,8 +3382,8 @@ while (*filter->pc)
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
);
@@ -3399,7 +3397,6 @@ while (*filter->pc)
{
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"
diff --git a/src/src/spam.c b/src/src/spam.c
index 6b03a848f..b05f2d708 100644
--- a/src/src/spam.c
+++ b/src/src/spam.c
@@ -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_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
diff --git a/src/src/transports/pipe.c b/src/src/transports/pipe.c
index 5b7fa1f5c..0361cc816 100644
--- a/src/src/transports/pipe.c
+++ b/src/src/transports/pipe.c
@@ -473,8 +473,7 @@ $pipe_addresses, which is not recognized by the normal expansion function. */
if (expand_arguments)
{
- uschar *s = cmd;
- uschar *p = Ustrstr(cmd, "pipe_addresses");
+ uschar * p = Ustrstr(cmd, "pipe_addresses");
gstring * g = NULL;
DEBUG(D_transport)