]> git.netwichtig.de Git - user/henk/code/exim.git/blobdiff - src/src/imap_utf7.c
Debug old ehlo-resp record date, on noting mismatch
[user/henk/code/exim.git] / src / src / imap_utf7.c
index 323225c231a06972832ca3858bc4431a5257f69a..6c9b5c17926d65768c2e39f282228206f2ee7df4 100644 (file)
@@ -1,3 +1,7 @@
+/* Copyright (c) University of Cambridge 1995 - 2018 */
+/* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
 #include "exim.h"
 
 #ifdef SUPPORT_I18N
@@ -11,7 +15,7 @@ static uschar encode_base64[64] =
 size_t slen;
 uschar *sptr;
 gstring * yield = NULL;
-int i = 0, j;  /* compiler quietening */
+int i = 0;     /* compiler quietening */
 uschar c = 0;  /* compiler quietening */
 BOOL base64mode = FALSE;
 BOOL lastsep = FALSE;
@@ -103,7 +107,7 @@ while (slen > 0)
         i = 0;
         }
 
-      for (j = 0; j < 2; j++, s++) switch (i++)
+      for (int j = 0; j < 2; j++, s++) switch (i++)
        {
        case 0:
          /* Top 6 bits of the first octet */
@@ -196,9 +200,7 @@ iconv_close(icd);
 #endif
 
 yield = string_catn(yield, outbuf, outptr - outbuf);
-
-if (yield->s[yield->ptr-1] == '.')
-  yield->ptr--;
+gstring_trim_trailing(yield, '.');
 
 return string_from_gstring(yield);
 }