Skip to content

Commit

Permalink
flush stdout after each line also when --live is combined with --json…
Browse files Browse the repository at this point in the history
… or --style 4, closes vergoh#206
  • Loading branch information
vergoh committed Jul 9, 2021
1 parent 67b36a3 commit 2807936
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/traffic.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ void livetrafficmeter(const char *iface, const int mode)
}
if (cfg.ostyle != 4) {
printf("%s", buffer);
fflush(stdout);
} else {
printf("%s\n", buffer);
}
Expand All @@ -283,6 +282,7 @@ void livetrafficmeter(const char *iface, const int mode)
printf("}}\n");
index++;
}
fflush(stdout);
#ifdef CHECK_VNSTAT
break;
#endif
Expand Down

0 comments on commit 2807936

Please sign in to comment.