]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix offset bug in %{string:...}
authorAlan T. DeKok <aland@freeradius.org>
Sun, 3 Jul 2011 09:07:49 +0000 (11:07 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 3 Jul 2011 09:07:49 +0000 (11:07 +0200)
It prints the correct amount with the correct limits, but
to the wrong location

src/main/xlat.c

index 04902ab26bb697d9061ce242ef4ef284d82f32bf..f450567e26f8078326996ae234e71fca09e1b53b 100644 (file)
@@ -469,10 +469,8 @@ static size_t xlat_string(UNUSED void *instance, REQUEST *request,
 
        if (vp->type != PW_TYPE_OCTETS) goto nothing;
 
-       *out++ = '"';
-       len = fr_print_string(vp->vp_strvalue, vp->length, out + 1, outlen - 3);
-       out[len] = '"';
-       out[len + 1] = '\0';
+       len = fr_print_string(vp->vp_strvalue, vp->length, out, outlen);
+       out[len] = '\0';
 
        return len + 2;
 }