]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
no-op escape function no longer needed
authorPhil Mayers <p.mayers@imperial.ac.uk>
Fri, 21 Sep 2012 16:51:56 +0000 (17:51 +0100)
committerPhil Mayers <p.mayers@imperial.ac.uk>
Fri, 5 Oct 2012 11:52:31 +0000 (12:52 +0100)
src/main/xlat.c

index c9512fbefdd3d79858c77162067d7e2977eb9dda..68b62ae7a3ec3415d773da5ba4124874348bebfc 100644 (file)
@@ -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) {