[Olsr-dev] [PATCH v1 029/115] jsoninfo: only need to reset entry number for json output

Ferry Huberts (spam-protected)
Wed Dec 2 21:28:02 CET 2015


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 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 22416f5..1236228 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.5.0




More information about the Olsr-dev mailing list