]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: http-conf: rename local trash variable
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Jul 2026 09:46:13 +0000 (11:46 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Jul 2026 13:21:58 +0000 (15:21 +0200)
In, sample_conv_url_enc(), the local trash variable was renamed to chk to
avoid mix-up with the global variable.

src/http_conv.c

index 98e7d4f78cf174d7a48129b33ddfc52b5c0de5fb..02c3a79b14b098d2e6d2c3a4d2e2d778f10f0e17 100644 (file)
@@ -340,11 +340,11 @@ static int sample_conv_url_enc(const struct arg *args, struct sample *smp, void
                *private)
 {
        enum encode_type enc_type;
-       struct buffer *trash = get_trash_chunk_sz(smp->data.u.str.data);
+       struct buffer *chk = get_trash_chunk_sz(smp->data.u.str.data);
        long *encode_map;
        char *ret;
 
-       if (!trash)
+       if (!chk)
                return 0;
 
        enc_type = args->data.sint;
@@ -354,12 +354,12 @@ static int sample_conv_url_enc(const struct arg *args, struct sample *smp, void
        else
                return 0;
 
-       ret = encode_chunk(trash->area, trash->area + trash->size, '%',
+       ret = encode_chunk(chk->area, chk->area + chk->size, '%',
                           encode_map, &smp->data.u.str, 0);
        if (ret == NULL || *ret != '\0')
                return 0;
-       trash->data = ret - trash->area;
-       smp->data.u.str = *trash;
+       chk->data = ret - chk->area;
+       smp->data.u.str = *chk;
        return 1;
 }