From 570f4d7f54c8342aa3244c568d73ab0167906bcf Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 1 Nov 2017 15:55:28 -0700 Subject: [PATCH] ircd::json: stringify empty array as expected by serialized size. --- ircd/json.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ircd/json.cc b/ircd/json.cc index c938d7560..66954c816 100644 --- a/ircd/json.cc +++ b/ircd/json.cc @@ -707,6 +707,12 @@ ircd::string_view ircd::json::stringify(mutable_buffer &buf, const array &v) { + if(string_view{v}.empty()) + { + consume(buf, copy(buf, value::empty_array)); + return value::empty_array; + } + consume(buf, copy(buf, string_view{v})); return string_view{v}; }