Commit 50b007da authored by Nils Goroll's avatar Nils Goroll

add variable for clarity

parent 2c43cb9e
......@@ -206,6 +206,7 @@ backref(VRT_CTX, VCL_INT refnum, VCL_STRING fallback, struct vmod_priv *task)
{
ov_t *ov;
char *substr;
const char *start;
int len;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
......@@ -234,11 +235,11 @@ backref(VRT_CTX, VCL_INT refnum, VCL_STRING fallback, struct vmod_priv *task)
if (ov->ovector[refnum] == -1)
return fallback;
start = ov->subject + ov->ovector[refnum];
len = ov->ovector[refnum+1] - ov->ovector[refnum];
assert(len <= ov->ovector[1] - ov->ovector[0]);
WS_Assert_Allocated(ctx->ws, ov->subject + ov->ovector[refnum], len);
substr = WS_Printf(ctx->ws, "%.*s", len,
ov->subject + ov->ovector[refnum]);
WS_Assert_Allocated(ctx->ws, start, len);
substr = WS_Printf(ctx->ws, "%.*s", len, start);
if (substr == NULL) {
VSLb(ctx->vsl, SLT_VCL_Error,
"vmod re: insufficient workspace");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment