tidying
authorJeremy Harris <jgh146exb@wizmail.org>
Tue, 26 Mar 2024 19:52:49 +0000 (19:52 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 26 Mar 2024 20:01:11 +0000 (20:01 +0000)
14 files changed:
src/exim_monitor/em_log.c
src/src/auths/cram_md5.c
src/src/dbfn.c
src/src/exim_dbmbuild.c
src/src/functions.h
src/src/routers/manualroute.c
src/src/routers/queryprogram.c
src/src/search.c
src/src/smtp_in.c
src/src/smtp_out.c
src/src/string.c
src/src/tls-openssl.c
src/src/verify.c
src/src/xclient.c

index fbcb6b1c01eed86a0038887fb358df0ec12ff19c..49f649d7e9b745192ad663aad23a19493e58b9e9 100644 (file)
@@ -294,7 +294,7 @@ if (LOG != NULL)
 
     if ((p = Ustrstr(buffer, "==")) != NULL)
       {
-      queue_item *qq = find_queue(id, queue_noop, 0);
+      queue_item * qq = find_queue(id, queue_noop, 0);
       if (qq)
         {
         dest_item *d;
@@ -302,14 +302,12 @@ if (LOG != NULL)
         p += 2;
         while (isspace(*p)) p++;
         q = p;
-        while (*p != 0 && !isspace(*p))
+        while (*p && !isspace(*p))
           {
           if (*p++ != '\"') continue;
-          while (*p != 0)
-            {
+          while (*p)
             if (*p == '\\') p += 2;
-              else if (*p++ == '\"') break;
-            }
+            else if (*p++ == '\"') break;
           }
         *p++ = 0;
         if ((r = strstric(q, qualify_domain, FALSE)) != NULL &&
index 8f00ee498e00f435fd26a1c436d1cf029bcc46ab..5817be7c93667239d18f28112687e0a57e78d25a 100644 (file)
@@ -198,7 +198,7 @@ The former is now the preferred variable; the latter is the original one. Then
 check that the remaining length is 32. */
 
 auth_vars[0] = expand_nstring[1] = clear;
-while (*clear && !isspace(*clear)) clear++;
+Uskip_nonwhite(&clear);
 if (!isspace(*clear)) return FAIL;
 *clear++ = 0;
 
index 13a3c2d66778b1daeb3b4bfe63716e43d38eb9c7..389d1518ed8a0249d6a3f0f75f8a78c941e64426 100644 (file)
@@ -544,8 +544,8 @@ while (Ufgets(buffer, 256, stdin) != NULL)
 
     Uskip_whitespace(&key);
     data = key;
-    while (*data && !isspace((uschar)*data)) data++;
-    *data++ = 0;
+    Uskip_nonwhite(&data);
+    *data++ = '\0';
     Uskip_whitespace(&data);
 
     dbwait = (dbdata_wait *)(&structbuffer);
index 9f5f2f042bc77b4e15aa9b13cdbaf477de25ccf0..bd24faa5b9d4e9e721fa35061e9d1bd3f5bfdc4c 100644 (file)
@@ -379,7 +379,7 @@ while (Ufgets(line, max_insize, f) != NULL)
     else
       {
       keystart = s;
-      while (*s != 0 && *s != ':' && !isspace(*s)) s++;
+      while (*s && *s != ':' && !isspace(*s)) s++;
       exim_datum_size_set(&key, s - keystart + add_zero);
       }
 
@@ -401,11 +401,11 @@ while (Ufgets(line, max_insize, f) != NULL)
     keybuffer[i] = 0;
     started = 1;
 
-    while (isspace(*s))s++;
+    while (isspace(*s)) s++;
     if (*s == ':')
       {
       s++;
-      while (isspace(*s))s++;
+      while (isspace(*s)) s++;
       }
     if (*s != 0)
       {
index 0e657d7c4d784672616ce2f5cc692042172ef239..d811c62a3986b795f9802d5f9b521a3e7839dfcc 100644 (file)
@@ -767,6 +767,12 @@ Return the next char as there's enough places using it to be useful. */
 static inline uschar skip_whitespace(const uschar ** sp)
 { while (isspace(**sp)) (*sp)++; return **sp; }
 
+/* Ditto, non-whitespace */
+
+#define Uskip_nonwhite(sp) skip_nonwhite(CUSS sp)
+static inline uschar skip_nonwhite(const uschar ** sp)
+{ while (**sp && !isspace(**sp)) (*sp)++; return **sp; }
+
 
 /******************************************************************************/
 
index ed497336bacfce1b45a709f0ff78965349f8d3d9..ffd6eeaca817b9eb5636cc75d19f2b0b8c297b97 100644 (file)
@@ -335,7 +335,7 @@ while (*options)
   unsigned n;
   const uschar * s = options;
 
-  while (*options && !isspace(*options)) options++;
+  Uskip_nonwhite(&options);
   n = options-s;
 
   if (Ustrncmp(s, "randomize", n) == 0) randomize = TRUE;
@@ -369,7 +369,7 @@ while (*options)
   if (*options)
     {
     options++;
-    while (*options && isspace(*options)) options++;
+    Uskip_whitespace(&options);
     }
   }
 
index 5f0f50cd956d6e2ffbc2af201ffb5cb98e1161ed..39645cd2306d3759d73b087f3067a84f83cc7515 100644 (file)
@@ -365,7 +365,7 @@ DEBUG(D_route) debug_printf("command wrote: %s\n", buffer);
 rword = buffer;
 Uskip_whitespace(&rword);
 rdata = rword;
-while (*rdata && !isspace(*rdata)) rdata++;
+Uskip_nonwhite(&rdata);
 if (*rdata) *rdata++ = '\0';
 
 /* The word must be a known yield name. If it is "REDIRECT", the rest of the
index 168c25e6a028a50c78dd5bd3d50eb8cc43e5ea8d..d0eb84b3bcc66c617cecd416665e4b1657a347b7 100644 (file)
@@ -247,7 +247,7 @@ if (mac_islookup(search_type, lookup_absfilequery))
   if (*query == '/')
     {
     uschar * s = query;
-    while (*query && !isspace(*query)) query++;
+    Uskip_nonwhite(&query);
     *fnamep = string_copyn(s, query - s);
     Uskip_whitespace(&query);
     }
index 79176687dac1638b8b5fcb85ecde970f3fd59807..70e4b95df2864ec141460eb9a6c7c4e923cddc50 100644 (file)
@@ -1946,6 +1946,9 @@ while (done <= 0)
     case HELP_CMD:
     case NOOP_CMD:
     case ETRN_CMD:
+#ifdef EXPERIMENTAL_WELLKNOWN
+    case WELLKNOWN_CMD:
+#endif
       bsmtp_transaction_linecount = receive_linecount;
       break;
 
@@ -2991,8 +2994,8 @@ switch (where)
 
     if (where == ACL_WHERE_AUTH)       /* avoid logging auth creds */
       {
-      uschar * s;
-      for (s = smtp_cmd_data; *s && !isspace(*s); ) s++;
+      uschar * s = smtp_cmd_data;
+      Uskip_nonwhite(&s);
       lim = s - smtp_cmd_data; /* atop after method */
       }
     what = string_sprintf("%s %.*s", acl_wherenames[where], lim, place);
@@ -5694,7 +5697,7 @@ while (done <= 0)
 
     case TOO_MANY_NONMAIL_CMD:
       s = smtp_cmd_buffer;
-      while (*s && !isspace(*s)) s++;
+      Uskip_nonwhite(&s);
       incomplete_transaction_log(US"too many non-mail commands");
       log_write(0, LOG_MAIN|LOG_REJECT, "SMTP call from %s dropped: too many "
        "nonmail commands (last was \"%.*s\")",  host_and_ident(FALSE),
index 888a0006e7ae4b227ee2e5148ebfdeadb74c8ae3..a78b15fbd1f719ba81efe2a5a89ddb215de27484 100644 (file)
@@ -709,7 +709,7 @@ if (format)
       {
       p += 5;
       Uskip_whitespace(&p);
-      while (!isspace(*p)) p++;
+      Uskip_nonwhite(&p);
       Uskip_whitespace(&p);
       }
     while (*p) *p++ = '*';
index af187c1992e13384795091e03946117bc2c2a584..379be2035c6d457d85e14cdb250e836faf0164ec 100644 (file)
@@ -649,7 +649,7 @@ uschar * t, * yield;
 /* First find the end of the string */
 
 if (*s != '\"')
-  while (*s && !isspace(*s)) s++;
+  Uskip_nonwhite(&s);
 else
   {
   s++;
index 64e8c711a402cc0d3c955038737f17054f0efd26..34612adea0974bf7117a057931285f388cf5f8a9 100644 (file)
@@ -5179,7 +5179,8 @@ for (uschar * s = exp; *s; /**/)
     return FALSE;
     }
   adding = *s++ == '+';
-  for (end = s; *end && !isspace(*end); ) end++;
+  end = s;
+  Uskip_nonwhite(&end);
   item_parsed = tls_openssl_one_option_parse(string_copyn(s, end-s), &item);
   if (!item_parsed)
     {
index 4f3bafb04cfd085aca640a76837cee6ff3259a84..065deec41512ee1784ce78bd93f39e73278bfc2e 100644 (file)
@@ -3081,7 +3081,7 @@ if (iplookup)
     {
     filename = semicolon + 1;
     key = filename;
-    while (*key != 0 && !isspace(*key)) key++;
+    Uskip_nonwhite(&key);
     filename = string_copyn(filename, key - filename);
     Uskip_whitespace(&key);
     }
index 2219cb02732a4e43c65e87444d6444b24b240ecb..fb9d95c5e2260d722356e7798a4b69695cdcd3cf 100644 (file)
@@ -172,7 +172,7 @@ for (state = XCLIENT_SKIP_SPACES; *s; )
       uschar * val;
 
       word = ++s;                      /* skip the = */
-      while (*s && !isspace(*s)) s++;
+      Uskip_nonwhite(&s);
       len = s - word;
 
       DEBUG(D_transport) debug_printf(" XCLIENT: \tvalue %.*s\n", len, word);