From b019636cd77d5b60abbf5978c904f8d1f7f5340a Mon Sep 17 00:00:00 2001 From: Remi Tricot-Le Breton Date: Mon, 2 Oct 2023 17:46:55 +0200 Subject: [PATCH] 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. --- src/sample.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;