From 6bf8f34d9f3a19efd11896a20f9c4b9a064a7b8f Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Mon, 10 Jan 2022 14:23:42 +0000 Subject: [PATCH] fix(engine): correctly format json output in json_event Signed-off-by: Jason Dellaluce --- userspace/engine/json_evt.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/userspace/engine/json_evt.cpp b/userspace/engine/json_evt.cpp index 8f22bc6f..3c14cb6b 100644 --- a/userspace/engine/json_evt.cpp +++ b/userspace/engine/json_evt.cpp @@ -1529,12 +1529,9 @@ void json_event_formatter::set_format(output_format of, const std::string &forma bool json_event_formatter::tostring_withformat(gen_event *gevt, std::string &output, gen_event_formatter::output_format of) { json_event *ev = static_cast(gevt); - - std::string ret; - if(of == OF_JSON) { - ret = tojson(ev); + output = tojson(ev); return true; } else