From: Alan T. DeKok Date: Sun, 3 Jul 2011 09:07:49 +0000 (+0200) Subject: Fix offset bug in %{string:...} X-Git-Tag: release_2_1_12~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=622bf3eeb511f2afb9bb538be67e3164162a1524;p=thirdparty%2Ffreeradius-server.git Fix offset bug in %{string:...} It prints the correct amount with the correct limits, but to the wrong location --- diff --git a/src/main/xlat.c b/src/main/xlat.c index 04902ab26bb..f450567e26f 100644 --- a/src/main/xlat.c +++ b/src/main/xlat.c @@ -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; }