MINOR: sample: make sample_parse_expr() use memprintf() to report parse errors
Doing so ensures that we're consistent between all the functions in the whole
chain. This is important so that we can extract the argument parsing from this
function.
diff --git a/src/log.c b/src/log.c
index ef89dd3..5cfd17e 100644
--- a/src/log.c
+++ b/src/log.c
@@ -344,16 +344,17 @@
struct sample_expr *expr;
struct logformat_node *node;
int cmd_arg;
+ char *errmsg = NULL;
cmd[0] = text;
cmd[1] = "";
cmd_arg = 0;
- expr = sample_parse_expr(cmd, &cmd_arg, trash.str, trash.size, &curpx->conf.args);
+ expr = sample_parse_expr(cmd, &cmd_arg, &errmsg, &curpx->conf.args);
if (!expr) {
Warning("parsing [%s:%d] : '%s' : sample fetch <%s> failed with : %s\n",
curpx->conf.args.file, curpx->conf.args.line, fmt_directive(curpx),
- text, trash.str);
+ text, errmsg);
return;
}