tidying
[exim.git] / src / src / expand.c
index 88d4e756f34aef9cc73aaba73ce741e7181472d1..59554840e4f60eb620ca461b7bdda423c776ab2c 100644 (file)
@@ -3,7 +3,7 @@
 *************************************************/
 
 /* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim Maintainers 2020 */
+/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -1593,7 +1593,7 @@ Returns:        NULL if the header does not exist, else a pointer to a new
 */
 
 static uschar *
-find_header(uschar *name, int *newsize, unsigned flags, uschar *charset)
+find_header(uschar *name, int *newsize, unsigned flags, const uschar *charset)
 {
 BOOL found = !name;
 int len = name ? Ustrlen(name) : 0;
@@ -2982,7 +2982,7 @@ switch(cond_type = identify_operator(&s, &opname))
        uschar errbuf[128];
        pcre2_get_error_message(err, errbuf, sizeof(errbuf));
        expand_string_message = string_sprintf("regular expression error in "
-         "\"%s\": %s at offset %d", sub[1], errbuf, offset);
+         "\"%s\": %s at offset %ld", sub[1], errbuf, (long)offset);
        return NULL;
        }
 
@@ -4319,7 +4319,6 @@ tree_node *t = NULL;
 const uschar * list;
 int sep = 0;
 uschar * item;
-uschar * suffix = US"";
 BOOL needsep = FALSE;
 #define LISTNAMED_BUF_SIZE 256
 uschar b[LISTNAMED_BUF_SIZE];
@@ -4335,10 +4334,10 @@ if (!listtype)          /* no-argument version */
   }
 else switch(*listtype) /* specific list-type version */
   {
-  case 'a': t = tree_search(addresslist_anchor,   name); suffix = US"_a"; break;
-  case 'd': t = tree_search(domainlist_anchor,    name); suffix = US"_d"; break;
-  case 'h': t = tree_search(hostlist_anchor,      name); suffix = US"_h"; break;
-  case 'l': t = tree_search(localpartlist_anchor, name); suffix = US"_l"; break;
+  case 'a': t = tree_search(addresslist_anchor,   name); break;
+  case 'd': t = tree_search(domainlist_anchor,    name); break;
+  case 'h': t = tree_search(hostlist_anchor,      name); break;
+  case 'l': t = tree_search(localpartlist_anchor, name); break;
   default:
     expand_string_message = US"bad suffix on \"list\" operator";
     return yield;
@@ -4592,7 +4591,7 @@ while (*s)
       unsigned flags = *name == 'r' ? FH_WANT_RAW
                      : *name == 'l' ? FH_WANT_RAW|FH_WANT_LIST
                      : 0;
-      uschar * charset = *name == 'b' ? NULL : headers_charset;
+      const uschar * charset = *name == 'b' ? NULL : headers_charset;
 
       s = read_header_name(name, sizeof(name), s);
       value = find_header(name, &newsize, flags, charset);