Fixed JSON format when -v 3 and -b is used

This commit is contained in:
Luca Deri
2017-05-22 14:14:45 +02:00
parent b89a2dce6f
commit cb6aabbf19
2 changed files with 5 additions and 2 deletions
+1
View File
@@ -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]))
+4 -2
View File
@@ -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);