From 6c2963b1c1b75b384ba6c9ce27e6272fdc11dc25 Mon Sep 17 00:00:00 2001 From: Neil McKee Date: Wed, 17 Jul 2019 11:04:45 -0700 Subject: [PATCH] json output bugfix --- configure.ac | 2 +- sflowtool.spec | 2 +- src/sflowtool.c | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 11fb922..f9140f0 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT([sflowtool],[5.03]) +AC_INIT([sflowtool],[5.04]) AC_CONFIG_SRCDIR([src/sflowtool.c]) AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) diff --git a/sflowtool.spec b/sflowtool.spec index 0237c89..c33942f 100644 --- a/sflowtool.spec +++ b/sflowtool.spec @@ -1,6 +1,6 @@ Summary: tool to ascii-print or forward sFlow datagrams Name: sflowtool -Version: 5.03 +Version: 5.04 Release: 1%{?dist} License: https://www.inmon.com/technology/sflowlicense.txt Group: Productivity/Networking/Diagnostic diff --git a/src/sflowtool.c b/src/sflowtool.c index 5f7cb32..e2d9da8 100644 --- a/src/sflowtool.c +++ b/src/sflowtool.c @@ -946,9 +946,11 @@ static void json_indent() { } static void json_start(char *fname, char bracket) { - if(sfConfig.jsonStart == NO) { - if(sfConfig.jsonListStart == NO) - putchar(','); + if(sfConfig.jsonStart) { + sfConfig.jsonStart = NO; + } + else if(sfConfig.jsonListStart == NO) { + putchar(','); json_indent(); } if(fname)