-/* $Cambridge: exim/src/src/auths/xtextencode.c,v 1.4 2007/01/08 10:50:19 ph10 Exp $ */
-
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2007 */
+/* Copyright (c) University of Cambridge 1995 - 2018 */
/* See the file NOTICE for conditions of use and distribution. */
#include "../exim.h"
auth_xtextencode(uschar *clear, int len)
{
uschar *code;
-uschar *p = (uschar *)clear;
+uschar *p = US clear;
uschar *pp;
int c = len;
int count = 1;
pp = code = store_get(count);
-p = (uschar *)clear;
+p = US clear;
c = len;
while (c-- > 0)
- {
if ((x = *p++) < 33 || x > 127 || x == '+' || x == '=')
- {
- sprintf(CS pp, "+%.02x", x); /* There's always room */
- pp += 3;
- }
- else *pp++ = x;
- }
+ pp += sprintf(CS pp, "+%.02x", x); /* There's always room */
+ else
+ *pp++ = x;
*pp = 0;
return code;