summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/src/smtp_in.c12
-rw-r--r--src/src/string.c5
2 files changed, 4 insertions, 13 deletions
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index 8b0902b5d..b9cf540a9 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -1821,20 +1821,14 @@ return g;
static gstring *
s_connhad_log(gstring * g)
{
-uschar * sep = smtp_connection_had[SMTP_HBUFF_SIZE-1] != SCH_NONE
+const uschar * sep = smtp_connection_had[SMTP_HBUFF_SIZE-1] != SCH_NONE
? US" C=..." : US" C=";
-for (int i = smtp_ch_index; i < SMTP_HBUFF_SIZE; i++)
+for (int i = smtp_ch_index; i < SMTP_HBUFF_SIZE; i++, sep = US",")
if (smtp_connection_had[i] != SCH_NONE)
- {
g = string_append(g, 2, sep, smtp_names[smtp_connection_had[i]]);
- sep = US",";
- }
-for (int i = 0; i < smtp_ch_index; i++)
- {
+for (int i = 0; i < smtp_ch_index; i++, sep = US",")
g = string_append(g, 2, sep, smtp_names[smtp_connection_had[i]]);
- sep = US",";
- }
return g;
}
diff --git a/src/src/string.c b/src/src/string.c
index 5acee1b00..3cacccce9 100644
--- a/src/src/string.c
+++ b/src/src/string.c
@@ -927,14 +927,11 @@ else
start of a string. Avoid getting working memory for an empty item. */
if (*s == sep)
- {
- s++;
- if (*s != sep || sep_is_special)
+ if (*++s != sep || sep_is_special)
{
*listptr = s;
return string_copy(US"");
}
- }
/* Not an empty string; the first character is guaranteed to be a data
character. */