From 0528100bf2d7f2492ce78b234c00eb5a3a416be4 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 12 Feb 2019 13:21:10 +0100 Subject: src: expr: fix build failure with json support Fixes: e3f195777ee54 ("src: expr: remove expr_ops from struct expr") Reported-by: Mikhail Morfikov Signed-off-by: Florian Westphal --- src/json.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/json.c') diff --git a/src/json.c b/src/json.c index dd7353e4..276a3c0f 100644 --- a/src/json.c +++ b/src/json.c @@ -33,18 +33,20 @@ static json_t *expr_print_json(const struct expr *expr, struct output_ctx *octx) { + const struct expr_ops *ops; char buf[1024]; FILE *fp; - if (expr->ops->json) - return expr->ops->json(expr, octx); + ops = expr_ops(expr); + if (ops->json) + return ops->json(expr, octx); printf("warning: expr ops %s have no json callback\n", expr_name(expr)); fp = octx->output_fp; octx->output_fp = fmemopen(buf, 1024, "w"); - expr->ops->print(expr, octx); + ops->print(expr, octx); fclose(octx->output_fp); octx->output_fp = fp; -- cgit v1.2.3