diff --git a/ircd/json.cc b/ircd/json.cc index d7b1ff109..257089275 100644 --- a/ircd/json.cc +++ b/ircd/json.cc @@ -41,7 +41,7 @@ struct ircd::json::input :qi::grammar { using it = const char *; - template using rule = qi::rule; + template using rule = qi::rule; rule<> NUL { lit('\0') ,"nul" }; @@ -174,7 +174,7 @@ struct ircd::json::output :karma::grammar { using it = char *; - template using rule = karma::rule; + template using rule = karma::rule; rule<> NUL { lit('\0') ,"nul" }; @@ -1073,8 +1073,13 @@ ircd::json::stack::member::member(object &po, s->append(","_sv); thread_local char tmp[2048]; + static const json::printer::rule rule + { + json::printer.name << json::printer.name_sep + }; + mutable_buffer buf{tmp}; - if(!printer(buf, json::printer.name << json::printer.name_sep, name)) + if(!printer(buf, rule, name)) throw error { "member name overflow: max size is under %zu", sizeof(tmp)