[exim-cvs] Rework "compiler quietening"

Etusivu
Poista viesti
Vastaa
Lähettäjä: Exim Git Commits Mailing List
Päiväys:  
Vastaanottaja: exim-cvs
Aihe: [exim-cvs] Rework "compiler quietening"
Gitweb: https://git.exim.org/exim.git/commitdiff/c7bec9723a721f566c67df0a526e4de18b723659
Commit:     c7bec9723a721f566c67df0a526e4de18b723659
Parent:     d439520cf2ccd61b0a2190bb331b1dded18547b8
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Dec 18 18:44:54 2022 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue Dec 20 18:16:00 2022 +0000


    Rework "compiler quietening"


    This partially reverts commit 0da41dc541d0f2536f9d2afc7188e9dfb97b0c09.
---
 src/src/lookups/ldap.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)


diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c
index ba77c98c2..b2ad3bbbc 100644
--- a/src/src/lookups/ldap.c
+++ b/src/src/lookups/ldap.c
@@ -1470,20 +1470,27 @@ t = quoted = store_get_quoted(len + count + 1, s, idx);
/* Handle plain quote_ldap */

 if (!dn)
-  for (; c = *s++; *t++ = c)
+  {
+  while ((c = *s++))
+    {
     if (!isalnum(c))
       {
       if (Ustrchr(LDAP_QUOTE, c) != NULL)
         {
         sprintf(CS t, "%%5C%02X", c);        /* e.g. * => %5C2A */
         t += 5;
+        continue;
         }
-      else if (Ustrchr(URL_NONQUOTE, c) == NULL)  /* e.g. ] => %5D */
+      if (Ustrchr(URL_NONQUOTE, c) == NULL)  /* e.g. ] => %5D */
         {
         sprintf(CS t, "%%%02X", c);
         t += 3;
+        continue;
         }
       }
+    *t++ = c;                                /* unquoted character */
+    }
+  }


/* Handle quote_ldap_dn */

@@ -1513,7 +1520,7 @@ else
       {
       if (Ustrchr(LDAP_DN_QUOTE, c) != NULL)
         {
-        Ustrcpy(t, US"%5C");            /* insert \ where needed */
+        memcpy(t, US"%5C", 3);            /* insert \ where needed */
         t += 3;                    /* fall through to check URL */
         }
       if (Ustrchr(URL_NONQUOTE, c) == NULL)  /* e.g. ] => %5D */
@@ -1530,7 +1537,7 @@ else


   while (*ss++)
     {
-    Ustrcpy(t, US"%5C%20");
+    memcpy(t, US"%5C%20", 6);
     t += 6;
     }
   }