From 32ab88a26e53e96131d5351736adbdb3a7bf1c40 Mon Sep 17 00:00:00 2001 From: Alexander Czyrny Date: Wed, 15 Apr 2020 10:12:37 +0200 Subject: 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. --- example/ndpiReader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'example/ndpiReader.c') 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) -- cgit v1.2.3