case vtype_pspace:
{
int inodes;
- sprintf(CS var_buffer, "%d",
+ sprintf(CS var_buffer, PR_EXIM_ARITH,
receive_statvfs(val == (void *)TRUE, &inodes));
}
return var_buffer;
rr;
rr = dns_next_rr(&dnsa, &dnss, RESET_NEXT)) if (rr->type == ind_type)
{
- int precedence;
- int weight = 0; /* For SRV records */
+ int precedence, weight;
int port = PORT_NONE;
const uschar * s = rr->data; /* MUST be unsigned for GETSHORT */
uschar data[256];
if (ind_type == T_MX)
weight = random_number(500);
-
- /* SRV records are specified with a port and a weight. The weight is used
- in a special algorithm. However, to start with, we just use it to order the
- records of equal priority (precedence). */
-
else
{
+ /* SRV records are specified with a port and a weight. The weight is used
+ in a special algorithm. However, to start with, we just use it to order the
+ records of equal priority (precedence). */
GETSHORT(weight, s);
GETSHORT(port, s);
}
never know what junk might get into the DNS (and this case has been seen on
more than one occasion). */
- if (last != NULL) /* This is not the first record */
+ if (last) /* This is not the first record */
{
host_item *prev = NULL;
for (h = host; h != last->next; prev = h, h = h->next)
- {
if (strcmpic(h->name, data) == 0)
{
DEBUG(D_host_lookup)
debug_printf("discarded duplicate host %s (MX=%d)\n", data,
- (precedence > h->mx)? precedence : h->mx);
+ precedence > h->mx ? precedence : h->mx);
if (precedence >= h->mx) goto NEXT_MX_RR; /* Skip greater precedence */
if (h == host) /* Override first item */
{
if (h == last) last = prev;
break;
}
- }
}
/* If this is the first MX or SRV record, put the data into the existing host
host->dnssec = dnssec;
last = host;
}
+ else
/* Make a new host item and seek the correct insertion place */
-
- else
{
int sort_key = precedence * 1000 + weight;
host_item *next = store_get(sizeof(host_item));
host->next = next;
if (last == host) last = next;
}
+ else
/* Else scan down the items we have inserted as part of this exercise;
don't go further. */
-
- else
{
for (h = host; h != last; h = h->next)
- {
if (sort_key < h->next->sort_key)
{
next->next = h->next;
h->next = next;
break;
}
- }
/* Join on after the last host item that's part of this
processing if we haven't stopped sooner. */
for (ppptr = pptr, hhh = h;
hhh != hh;
- ppptr = &(hhh->next), hhh = hhh->next)
- {
- if (hhh->sort_key >= randomizer) break;
- }
+ ppptr = &hhh->next, hhh = hhh->next)
+ if (hhh->sort_key >= randomizer)
+ break;
/* hhh now points to the host that should go first; ppptr points to the
place that points to it. Unfortunately, if the start of the minilist is
hhh->next = temp.next;
h->next = hhh;
}
-
else
{
hhh->next = h; /* The rest of the chain follows it */
void
log_write(unsigned int selector, int flags, const char *format, ...)
{
-uschar * ptr;
int paniclogfd;
ssize_t written_len;
gstring gs = { .size = LOG_BUFFER_SIZE-1, .ptr = 0, .s = log_buffer };
if ((space >= 0 && space < check_spool_space) ||
(inodes >= 0 && inodes < check_spool_inodes))
{
- log_write(0, LOG_MAIN, "spool directory space check failed: space=%d "
- "inodes=%d", space, inodes);
+ log_write(0, LOG_MAIN, "spool directory space check failed: space="
+ PR_EXIM_ARITH " inodes=%d", space, inodes);
return FALSE;
}
}
{
while (*s != 0 && isspace(*s)) s++;
-if (domain != NULL)
+if (domain)
{
- if (*s == 0) return FALSE; /* missing data */
+ if (!*s) return FALSE; /* missing data */
*domain = string_dequote(&s);
- while (*s != 0 && isspace(*s)) s++;
+ while (*s && isspace(*s)) s++;
}
*hostlist = string_dequote(&s);
-while (*s != 0 && isspace(*s)) s++;
+while (*s && isspace(*s)) s++;
*options = s;
return TRUE;
}
/* The initialization check ensures that either route_list or route_data is
set. */
-if (ob->route_list != NULL)
+if (ob->route_list)
{
int sep = -(';'); /* Default is semicolon */
listptr = ob->route_list;
}
}
- if (route_item == NULL) return DECLINE; /* No pattern in the list matched */
+ if (!route_item) return DECLINE; /* No pattern in the list matched */
}
/* Handle a single routing item in route_data. If it expands to an empty
else
{
- route_item = rf_expand_data(addr, ob->route_data, &rc);
- if (route_item == NULL) return rc;
+ if (!(route_item = rf_expand_data(addr, ob->route_data, &rc)))
+ return rc;
(void) parse_route_item(route_item, NULL, &hostlist, &options);
if (hostlist[0] == 0) return DECLINE;
}
uschar *user_msg = NULL;
uschar *log_msg = NULL;
-/* Check for recursive acll */
+/* Check for recursive call */
if (fl.smtp_exit_function_called)
{
tls_in.active.sock = -1;
/* Write an SMTP response if we are expected to give one. As the default
-responses are all internal, they should always fit in the buffer, but code a
-warning, just in case. Note that string_vformat() still leaves a complete
-string, even if it is incomplete. */
+responses are all internal, they should be reasonable size. */
if (code && defaultrespond)
{
/* First find the end of the string */
if (*s != '\"')
- {
while (*s != 0 && !isspace(*s)) s++;
- }
else
{
s++;
- while (*s != 0 && *s != '\"')
+ while (*s && *s != '\"')
{
if (*s == '\\') (void)string_interpret_escape(&s);
s++;
}
- if (*s != 0) s++;
+ if (*s) s++;
}
/* Get enough store to copy into */