diff options
author | Florian Westphal <fw@strlen.de> | 2019-02-12 13:21:10 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2019-02-12 13:23:41 +0100 |
commit | 0528100bf2d7f2492ce78b234c00eb5a3a416be4 (patch) | |
tree | 8cc51543144868427c7bc9ff95894b1dc17e2cd9 /src/json.c | |
parent | e3f195777ee54c7a57aab932b64c6ecbd782f68f (diff) |
src: expr: fix build failure with json support
Fixes: e3f195777ee54 ("src: expr: remove expr_ops from struct expr")
Reported-by: Mikhail Morfikov <mmorfikov@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; |