]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: sample: Add a comment in 'check_operator' to explain why 'vars_check_arg' should...
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Mon, 2 Oct 2023 15:46:55 +0000 (17:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 3 Oct 2023 09:13:10 +0000 (11:13 +0200)
This extra comment ensure that we do not try to pass an 'err' argument
to 'vars_check_arg' otherwise some warnings will be raised if an
operator is given an integer directly in the configuration file.

src/sample.c

index bb7db28e797798e17f27b9f0f8e0bd360b78f65c..57cb7c6f826652c32b7cb5da8b9c65b1e45f4cc9 100644 (file)
@@ -3155,7 +3155,10 @@ static int check_operator(struct arg *args, struct sample_conv *conv,
        const char *end;
        long long int i;
 
-       /* Try to decode a variable. */
+       /* Try to decode a variable. The 'err' variable is intentionnaly left
+        * NULL since the operators accept an integer as argument in which case
+        * vars_check_arg call will fail.
+        */
        if (vars_check_arg(&args[0], NULL))
                return 1;