aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
authorAlexander Czyrny <mail@czyrny.net>2020-04-15 10:12:37 +0200
committerGitHub <noreply@github.com>2020-04-15 10:12:37 +0200
commit32ab88a26e53e96131d5351736adbdb3a7bf1c40 (patch)
tree63d49591ff996e2664769cb11a315f4dc5820592 /example/ndpiReader.c
parentafdae85b30add25b93df65f1cade1d6c15f855f8 (diff)
Fix for missing line breaks in CSV file
If "-v" is used as an argument, the line breaks are missing in the csv file ("-C"), because the argument "-J" is assumed. Moving the condition for the CSV file handler out of the scope of the "enable_joy_stats" condition removes this dependency and the CSV file is formatted correctly.
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 91eca9bd2..d64918b85 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -1146,10 +1146,11 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
if(enable_joy_stats) {
/* Print entropy values for monitored flows. */
flowGetBDMeanandVariance(flow);
- if(csv_fp) fprintf(csv_fp, "\n");
fflush(out);
fprintf(out, "[score: %.4f]", flow->entropy.score);
}
+
+ if(csv_fp) fprintf(csv_fp, "\n");
fprintf(out, "[proto: ");
if(flow->tunnel_type != ndpi_no_tunnel)