tools: tweak: add missing newline in progress
Given:
The bridge is enabled!
Received address: 0x47ff0000
Progress: 100.00%Sending over the hash file.
Add the missing newline when the progress output reaches 100%.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I83f97144fcc6d675e2bace050de81bd0084338d2
diff --git a/tools/progress.cpp b/tools/progress.cpp
index a395ca3..aafb1de 100644
--- a/tools/progress.cpp
+++ b/tools/progress.cpp
@@ -27,6 +27,9 @@
currentBytes += bytes;
std::fprintf(stdout, "\rProgress: %.2f%%",
100.0 * currentBytes / totalBytes);
+ if (currentBytes == totalBytes)
+ std::fprintf(stdout, "\n");
+
std::fflush(stdout);
}