From 524fec0daf15052cac42f29206360ebe9b9db6b5 Mon Sep 17 00:00:00 2001 From: Ferry Huberts Date: Tue, 1 Dec 2015 15:09:13 +0100 Subject: [PATCH] jsoninfo: only need to reset entry number for json output Signed-off-by: Ferry Huberts --- lib/jsoninfo/src/olsrd_jsoninfo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/jsoninfo/src/olsrd_jsoninfo.c b/lib/jsoninfo/src/olsrd_jsoninfo.c index 22416f5e..12362283 100644 --- a/lib/jsoninfo/src/olsrd_jsoninfo.c +++ b/lib/jsoninfo/src/olsrd_jsoninfo.c @@ -396,9 +396,6 @@ static void send_info(unsigned int send_what, int the_socket) { int contentLengthPlaceholderStart = 0; int headerLength = 0; - /* global variables for tracking when to put a comma in for JSON */ - abuf_json_reset_entry_number_and_depth(); - abuf_init(&abuf, 2 * 4096); if (http_headers) { @@ -408,6 +405,8 @@ static void send_info(unsigned int send_what, int the_socket) { // only add if normal format if (send_what & SIW_ALL) { + /* global variables for tracking when to put a comma in for JSON */ + abuf_json_reset_entry_number_and_depth(); abuf_json_mark_output(true, &abuf); abuf_json_int(&abuf, "systemTime", time(NULL)); -- 2.20.1