Fix post-transport-crash.
[exim.git] / src / src / imap_utf7.c
index 10cc1f7fa15dc29de644ea860e15e98cf112271c..7fa03aa50818ea76fa0471ee22178b254245d744 100644 (file)
@@ -12,8 +12,8 @@ int ptr = 0;
 int size = 0;
 size_t slen;
 uschar *sptr, *yield = NULL;
-int i, j;
-uschar c;
+int i = 0, j;  /* compiler quietening */
+uschar c = 0;  /* compiler quietening */
 BOOL base64mode = FALSE;
 BOOL lastsep = FALSE;
 uschar utf16buf[256];
@@ -25,7 +25,7 @@ uschar *outptr = outbuf;
 iconv_t icd;
 #endif
 
-if (!specials) specials = "";
+if (!specials) specials = US"";
 
 /* Pass over the string. If it consists entirely of "normal" characters
    (possibly with leading seps), return it as is. */
@@ -37,7 +37,7 @@ for (s = string; *s; s++)
      || *s < 0x20
      || strchr("./&", *s)
      || *s == sep
-     || strchr(specials, *s)
+     || Ustrchr(specials, *s)
      )
     break;
   }
@@ -49,7 +49,7 @@ sptr = string;
 slen = Ustrlen(string);
 
 #if HAVE_ICONV
-if ((icd = iconv_open(US"UTF-16BE", charset)) == (iconv_t)-1)
+if ((icd = iconv_open("UTF-16BE", CCS charset)) == (iconv_t)-1)
   {
   *error = string_sprintf(
        "imapfolder: iconv_open(\"UTF-16BE\", \"%s\") failed: %s%s",
@@ -92,7 +92,7 @@ while (slen > 0)
     if (  s[0] != 0
        || s[1] >= 0x7f
        || s[1] < 0x20
-       || (strchr(specials, s[1]) && s[1] != sep)
+       || (Ustrchr(specials, s[1]) && s[1] != sep)
        )
       {
       lastsep = FALSE;