summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/text/json_formatter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/text/json_formatter.cpp b/src/text/json_formatter.cpp
index 44acd61713..543a9db583 100644
--- a/src/text/json_formatter.cpp
+++ b/src/text/json_formatter.cpp
@@ -35,7 +35,9 @@ namespace //anonymous
class json_fmt_visitor : public const_nbt_visitor
{
public:
- json_fmt_visitor(std::ostream& os): os(os) {}
+ json_fmt_visitor(std::ostream& os, const json_formatter& fmt):
+ os(os)
+ {}
void visit(const tag_byte& b) override
{ os << static_cast<int>(b.get()) << "b"; } //We don't want to print a character
@@ -185,7 +187,7 @@ namespace //anonymous
void json_formatter::write(std::ostream& os, const tag& t) const
{
- json_fmt_visitor v(os);
+ json_fmt_visitor v(os, *this);
t.accept(v);
}