tidying
authorJeremy Harris <jgh146exb@wizmail.org>
Wed, 14 Nov 2018 20:22:50 +0000 (20:22 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Wed, 14 Nov 2018 22:31:54 +0000 (22:31 +0000)
src/src/acl.c
src/src/debug.c
src/src/expand.c
src/src/header.c
src/src/host.c
src/src/log.c
src/src/parse.c
src/src/string.c

index 6cce0aae66b74c986c9cb01e37144f2747abca25..14079a65586a9ef7438bb86e8f57c460fb3d2bf6 100644 (file)
@@ -2165,8 +2165,6 @@ Arguments:
   log_msgptr  for error messages
   format      format string
   ...         supplementary arguments
   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
 */
 
 Returns:      ERROR
 */
@@ -3566,7 +3564,6 @@ for (; cb; cb = cb->next)
         }
       while (isspace(*s)) s++;
 
         }
       while (isspace(*s)) s++;
 
-
       if (logbits == 0) logbits = LOG_MAIN;
       log_write(0, logbits, "%s", string_printing(s));
       }
       if (logbits == 0) logbits = LOG_MAIN;
       log_write(0, logbits, "%s", string_printing(s));
       }
index 4b076514758996fb50a997a05425706a26411a43..6aa2c41cb19ea1356dd2584385f571aea2c3ef26 100644 (file)
@@ -244,7 +244,7 @@ if (!string_vformat(debug_ptr,
   Ustrcpy(p, 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,
 
 /* 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,
index 49e09ecd8e9c3480ec87e9e12847b45015b62fb4..fcf170dc3f84b35d748b73d302e24c5a61af5df9 100644 (file)
@@ -7272,9 +7272,9 @@ while (*s != 0)
       case EOP_RFC2047:
         {
         uschar buffer[2048];
       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;
         }
 
         continue;
         }
 
index decd0cce69a107e43b141314a62381954295e566..51aa9f953e6f4638300107b5d9f8e53df1fd34df 100644 (file)
@@ -99,7 +99,7 @@ header_line **hptr;
 uschar *p, *q;
 uschar buffer[HEADER_ADD_BUFFER_SIZE];
 
 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: "
 
 if (!string_vformat(buffer, sizeof(buffer), format, ap))
   log_write(0, LOG_MAIN|LOG_PANIC_DIE, "string too long in header_add: "
@@ -107,7 +107,7 @@ if (!string_vformat(buffer, sizeof(buffer), format, ap))
 
 /* Find where to insert this header */
 
 
 /* Find where to insert this header */
 
-if (name == NULL)
+if (!name)
   {
   if (after)
     {
   {
   if (after)
     {
@@ -122,7 +122,7 @@ if (name == NULL)
     received header is allocated and when it is actually filled in. We want
     that header to be first, so skip it for now. */
 
     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;
     }
       hptr = &header_list->next;
     h = *hptr;
     }
@@ -134,15 +134,14 @@ else
 
   /* Find the first non-deleted header with the correct name. */
 
 
   /* 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. */
 
 
   /* 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)
       {
     {
     if (topnot)
       {
@@ -155,14 +154,12 @@ else
   true. In this case, we want to include deleted headers in the block. */
 
   else if (after)
   true. In this case, we want to include deleted headers in the block. */
 
   else if (after)
-    {
     for (;;)
       {
     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;
       }
       hptr = &(h->next);
       h = h->next;
       }
-    }
   }
 
 /* Loop for multiple header lines, taking care about continuations. At this
   }
 
 /* Loop for multiple header lines, taking care about continuations. At this
@@ -174,7 +171,7 @@ for (p = q = buffer; *p != 0; )
   for (;;)
     {
     q = Ustrchr(q, '\n');
   for (;;)
     {
     q = Ustrchr(q, '\n');
-    if (q == NULL) q = p + Ustrlen(p);
+    if (!q) q = p + Ustrlen(p);
     if (*(++q) != ' ' && *q != '\t') break;
     }
 
     if (*(++q) != ' ' && *q != '\t') break;
     }
 
@@ -187,7 +184,7 @@ for (p = q = buffer; *p != 0; )
   *hptr = new;
   hptr = &(new->next);
 
   *hptr = new;
   hptr = &(new->next);
 
-  if (h == NULL) header_last = new;
+  if (!h) header_last = new;
   p = q;
   }
 }
   p = q;
   }
 }
index 0da99334a8dc8195d764af901b40df62a7c550f8..208e567a1be7b3f9d9b8d78e114c2aa00125878c 100644 (file)
@@ -1796,7 +1796,7 @@ while ((ordername = string_nextinlist(&list, &sep, buffer, sizeof(buffer))))
 /* If we have failed to find a name, return FAIL and log when required.
 NB host_lookup_msg must be in permanent store.  */
 
 /* 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 "
   {
   if (host_checking || !f.log_testing_mode)
     log_write(L_host_lookup_failed, LOG_MAIN, "no host name found for IP "
@@ -1832,15 +1832,9 @@ for (hname = sender_host_name; hname; hname = *aliases++)
   {
   int rc;
   BOOL ok = FALSE;
   {
   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
 
   if (  (rc = host_find_bydns(&h, NULL, HOST_FIND_BY_A | HOST_FIND_BY_AAAA,
          NULL, NULL, NULL, &d, NULL, NULL)) == HOST_FOUND
@@ -2598,7 +2592,7 @@ f.host_find_failed_syntax = FALSE;
 assume TCP protocol. DNS domain names are constrained to a maximum of 256
 characters, so the code below should be safe. */
 
 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;
   {
   uschar buffer[300];
   uschar *temp_fully_qualified_name = buffer;
index 2832f4ed009b6056f7595f752cb335b5893f2b3a..678c02be79d948b8f082af0d2625d904da3fc627 100644 (file)
@@ -560,13 +560,13 @@ log_config_info(uschar *ptr, int flags)
 Ustrcpy(ptr, "Exim configuration error");
 ptr += 24;
 
 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;
   }
 
   {
   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  ");
   ptr += sprintf(CS ptr, " in line %d of %s", config_lineno, config_filename);
 
 Ustrcpy(ptr, ":\n  ");
index 46f9751ab1158d5e30c972a89bcaf5dd7d9b2f3c..4b0efa0e1367ff6b0de3783bc9de84500e7d786e 100644 (file)
@@ -876,7 +876,7 @@ int hlen;
 BOOL coded = FALSE;
 BOOL first_byte = FALSE;
 
 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! */
 
 
 /* We don't expect this to fail! */
 
@@ -925,7 +925,7 @@ for (; len > 0; len--)
 *t++ = '=';
 *t = 0;
 
 *t++ = '=';
 *t = 0;
 
-return coded? buffer : string;
+return coded ? buffer : string;
 }
 
 
 }
 
 
index 3abe2a3bdbd07de686ee2968f194ece565a1e296..112c2adc32c3892479f39bea4d512c0041b5c569 100644 (file)
@@ -701,7 +701,7 @@ return yield;
 *          Format a string and save it           *
 *************************************************/
 
 *          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:
 everything.
 
 Arguments: