diff options
author | Luca Deri <deri@ntop.org> | 2017-05-22 14:14:45 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2017-05-22 14:14:45 +0200 |
commit | cb6aabbf19cbde51b70a4c734f9584b3d2fb3431 (patch) | |
tree | ade1da5787cf7f39f2c015351ca381e8f2e4fa5c | |
parent | b89a2dce6f9a750219babe42276480396a78546b (diff) |
Fixed JSON format when -v 3 and -b is used
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | example/ndpiReader.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index c970cbe5b..959ee76de 100644 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,7 @@ else fi fi +dnl> https://github.com/json-c/json-c AC_ARG_ENABLE([json-c], AS_HELP_STRING([--disable-json-c], [Disable json-c support])) diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 20b423166..2b683bf53 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -399,7 +399,6 @@ static void parseOptions(int argc, char **argv) { printf("WARNING: this copy of ndpiReader has been compiled without JSON-C: json export disabled\n"); #else _statsFilePath = optarg; - printf("FILE PATH %s\n",_statsFilePath); stats_flag = 1; #endif break; @@ -1636,9 +1635,12 @@ static void printResults(u_int64_t tot_usec) { else { file_first_time = 0; + fprintf(stats_fp,"[\n"); saveTopStats(stats_fp, topSrcStats, DIR_SRC, total_src_addr); + fprintf(stats_fp,",\n"); saveTopStats(stats_fp, topDstStats, DIR_DST, total_dst_addr); - + fprintf(stats_fp,"]\n"); + fclose(stats_fp); deleteTopStats(topSrcStats), deleteTopStats(topDstStats); |