From: Phil Mayers Date: Fri, 21 Sep 2012 16:51:56 +0000 (+0100) Subject: no-op escape function no longer needed X-Git-Tag: release_3_0_0_beta1~1662^2~1^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e41b56db37903c24ff454b20ff1f3863fa91979;p=thirdparty%2Ffreeradius-server.git no-op escape function no longer needed --- diff --git a/src/main/xlat.c b/src/main/xlat.c index c9512fbefdd..68b62ae7a3e 100644 --- a/src/main/xlat.c +++ b/src/main/xlat.c @@ -1141,32 +1141,6 @@ done: return 0; } -/* - * If the caller doesn't pass xlat an escape function, then - * we use this one. It simplifies the coding, as the check for - * func == NULL only happens once. - */ -static size_t xlat_copy(UNUSED REQUEST *request, char *out, size_t outlen, const char *in, UNUSED void *arg) -{ - int freespace = outlen; - - if (outlen < 1) return 0; - - while ((*in) && (freespace > 1)) { - /* - * Copy data. - * - * FIXME: Do escaping of bad stuff! - */ - *(out++) = *(in++); - - freespace--; - } - *out = '\0'; - - return (outlen - freespace); /* count does not include NUL */ -} - /** * @brief Replace %whatever in a string. * @@ -1196,13 +1170,6 @@ int radius_xlat(char *out, int outlen, const char *fmt, */ if (!fmt || !out || !request) return 0; - /* - * Ensure that we always have an escaping function. - */ - if (func == NULL) { - func = xlat_copy; - } - q = out; p = fmt; while (*p) {