]> git.ipfire.org Git - thirdparty/nftables.git/commit
json: Fix datatype_json() for literal level
authorPhil Sutter <phil@nwl.cc>
Tue, 11 Sep 2018 20:14:24 +0000 (22:14 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 13 Sep 2018 08:41:34 +0000 (10:41 +0200)
commit5fb4942292c30be7225c4bbbc04fb3eecbf514fd
treece23433c8b4d19e508434b16d19605e65c1a4d1b
parentd90daac1aec5f5233cecaffdcc2847b87896aef7
json: Fix datatype_json() for literal level

If a datatype doesn't provide a 'json' callback, datatype_json() uses
fmemopen() to grab the output from 'print' callback. When doing so,
reuse the existing output context instead of creating a dedicated one to
make sure all output-related settings are exactly as expected.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
src/json.c