Skip to content

Commit

Permalink
Flush stdout after every progress update.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGreatMcPain committed Jul 24, 2022
1 parent f75e16f commit 1d345fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/3dplanes.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ int getOFMDsInFile(size_t storeSize, size_t bufferSize, const char *filename,
if (progress != prevProgress) {
if (prettyPrint) {
printf("\rProgress: %d%s", progress, "%");
fflush(stdout);
} else {
printf("Progress: %d%s\n", progress, "%");
fflush(stdout);
}
prevProgress = progress;
}
Expand All @@ -233,8 +235,10 @@ int getOFMDsInFile(size_t storeSize, size_t bufferSize, const char *filename,
if (prettyPrint) {
printf("\rProgress: %d%s", progress, "%");
printf("\n");
fflush(stdout);
} else {
printf("Progress: %d%s\n", progress, "%");
fflush(stdout);
}
prevProgress = progress;
}
Expand Down

0 comments on commit 1d345fb

Please sign in to comment.