SPDX: license tags (mostly by guesswork)
[exim.git] / src / src / auths / xtextencode.c
index 38237207efdca112ccf9cafca7f2fab2ad0bea40..89f12f1f1f9233d9d8fcbd5dc707a31a0b5e6400 100644 (file)
@@ -2,8 +2,10 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2009 */
+/* Copyright (c) The Exim Maintainers 2022 */
+/* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-only */
 
 #include "../exim.h"
 
@@ -28,7 +30,7 @@ uschar *
 auth_xtextencode(uschar *clear, int len)
 {
 uschar *code;
-uschar *p = (uschar *)clear;
+uschar *p = US clear;
 uschar *pp;
 int c = len;
 int count = 1;
@@ -40,9 +42,9 @@ in order to get the right amount of store. */
 while (c -- > 0)
   count += ((x = *p++) < 33 || x > 127 || x == '+' || x == '=')? 3 : 1;
 
-pp = code = store_get(count);
+pp = code = store_get(count, clear);
 
-p = (uschar *)clear;
+p = US clear;
 c = len;
 while (c-- > 0)
   if ((x = *p++) < 33 || x > 127 || x == '+' || x == '=')