log_msgptr for error messages
format format string
... supplementary arguments
- ss ratelimit option name
- where ACL_WHERE_xxxx indicating which ACL this is
Returns: ERROR
*/
}
while (isspace(*s)) s++;
-
if (logbits == 0) logbits = LOG_MAIN;
log_write(0, logbits, "%s", string_printing(s));
}
Ustrcpy(p, s);
}
-while(*debug_ptr != 0) debug_ptr++;
+while(*debug_ptr) debug_ptr++;
/* Output the line if it is complete. If we added any prefix data and there
are internal newlines, make sure the prefix is on the continuation lines,
case EOP_RFC2047:
{
uschar buffer[2048];
- const uschar *string = parse_quote_2047(sub, Ustrlen(sub), headers_charset,
- buffer, sizeof(buffer), FALSE);
- yield = string_cat(yield, string);
+ yield = string_cat(yield,
+ parse_quote_2047(sub, Ustrlen(sub), headers_charset,
+ buffer, sizeof(buffer), FALSE));
continue;
}
uschar *p, *q;
uschar buffer[HEADER_ADD_BUFFER_SIZE];
-if (header_last == NULL) return;
+if (!header_last) return;
if (!string_vformat(buffer, sizeof(buffer), format, ap))
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "string too long in header_add: "
/* Find where to insert this header */
-if (name == NULL)
+if (!name)
{
if (after)
{
received header is allocated and when it is actually filled in. We want
that header to be first, so skip it for now. */
- if (header_list->text == NULL)
+ if (!header_list->text)
hptr = &header_list->next;
h = *hptr;
}
/* Find the first non-deleted header with the correct name. */
- for (hptr = &header_list; (h = *hptr) != NULL; hptr = &(h->next))
- {
- if (header_testname(h, name, len, TRUE)) break;
- }
+ for (hptr = &header_list; (h = *hptr); hptr = &h->next)
+ if (header_testname(h, name, len, TRUE))
+ break;
/* Handle the case where no header is found. To insert at the bottom, nothing
needs to be done. */
- if (h == NULL)
+ if (!h)
{
if (topnot)
{
true. In this case, we want to include deleted headers in the block. */
else if (after)
- {
for (;;)
{
- if (h->next == NULL || !header_testname(h, name, len, FALSE)) break;
+ if (!h->next || !header_testname(h, name, len, FALSE)) break;
hptr = &(h->next);
h = h->next;
}
- }
}
/* Loop for multiple header lines, taking care about continuations. At this
for (;;)
{
q = Ustrchr(q, '\n');
- if (q == NULL) q = p + Ustrlen(p);
+ if (!q) q = p + Ustrlen(p);
if (*(++q) != ' ' && *q != '\t') break;
}
*hptr = new;
hptr = &(new->next);
- if (h == NULL) header_last = new;
+ if (!h) header_last = new;
p = q;
}
}
/* If we have failed to find a name, return FAIL and log when required.
NB host_lookup_msg must be in permanent store. */
-if (sender_host_name == NULL)
+if (!sender_host_name)
{
if (host_checking || !f.log_testing_mode)
log_write(L_host_lookup_failed, LOG_MAIN, "no host name found for IP "
{
int rc;
BOOL ok = FALSE;
- host_item h;
- dnssec_domains d;
-
- h.next = NULL;
- h.name = hname;
- h.mx = MX_NONE;
- h.address = NULL;
- d.request = sender_host_dnssec ? US"*" : NULL;;
- d.require = NULL;
+ host_item h = { .next = NULL, .name = hname, .mx = MX_NONE, .address = NULL };
+ dnssec_domains d =
+ { .request = sender_host_dnssec ? US"*" : NULL, .require = NULL };
if ( (rc = host_find_bydns(&h, NULL, HOST_FIND_BY_A | HOST_FIND_BY_AAAA,
NULL, NULL, NULL, &d, NULL, NULL)) == HOST_FOUND
assume TCP protocol. DNS domain names are constrained to a maximum of 256
characters, so the code below should be safe. */
-if ((whichrrs & HOST_FIND_BY_SRV) != 0)
+if (whichrrs & HOST_FIND_BY_SRV)
{
uschar buffer[300];
uschar *temp_fully_qualified_name = buffer;
Ustrcpy(ptr, "Exim configuration error");
ptr += 24;
-if ((flags & (LOG_CONFIG_FOR & ~LOG_CONFIG)) != 0)
+if (flags & (LOG_CONFIG_FOR & ~LOG_CONFIG))
{
Ustrcpy(ptr, " for ");
return ptr + 5;
}
-if ((flags & (LOG_CONFIG_IN & ~LOG_CONFIG)) != 0)
+if (flags & (LOG_CONFIG_IN & ~LOG_CONFIG))
ptr += sprintf(CS ptr, " in line %d of %s", config_lineno, config_filename);
Ustrcpy(ptr, ":\n ");
BOOL coded = FALSE;
BOOL first_byte = FALSE;
-if (charset == NULL) charset = US"iso-8859-1";
+if (!charset) charset = US"iso-8859-1";
/* We don't expect this to fail! */
*t++ = '=';
*t = 0;
-return coded? buffer : string;
+return coded ? buffer : string;
}
* Format a string and save it *
*************************************************/
-/* The formatting is done by string_format, which checks the length of
+/* The formatting is done by string_vformat, which checks the length of
everything.
Arguments: