From: Remi Tricot-Le Breton Date: Mon, 2 Oct 2023 15:46:55 +0000 (+0200) Subject: DOC: sample: Add a comment in 'check_operator' to explain why 'vars_check_arg' should... X-Git-Tag: v2.9-dev7~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b019636cd77d5b60abbf5978c904f8d1f7f5340a;p=thirdparty%2Fhaproxy.git DOC: sample: Add a comment in 'check_operator' to explain why 'vars_check_arg' should ignore the 'err' buffer 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. --- diff --git a/src/sample.c b/src/sample.c index bb7db28e79..57cb7c6f82 100644 --- a/src/sample.c +++ b/src/sample.c @@ -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;