summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2022-10-23 01:16:03 +0900
committerRyo Nakamura <upa@haeena.net>2022-10-23 01:16:03 +0900
commit3849cc6bc67044421ec1e1447e5eec20c5938a47 (patch)
treec3369e10b1956f92caf39fae8fafafb065d48158 /src/main.c
parent75a1d8e73778697b911d6bcb3efa4e035fdeb229 (diff)
fix on progress bar
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 1981525..1dec890 100644
--- a/src/main.c
+++ b/src/main.c
@@ -422,7 +422,7 @@ static void print_progress(double percent, char *suffix)
memset(buf, 0, sizeof(buf));
thresh = floor(bar_width * (percent / 100)) - 1;
- buf[0] = '[';
+
for (n = 1; n < bar_width - 1; n++) {
if (n <= thresh)
buf[n] = '=';
@@ -430,6 +430,7 @@ static void print_progress(double percent, char *suffix)
buf[n] = ' ';
}
buf[thresh] = '>';
+ buf[0] = '[';
buf[bar_width - 1] = ']';
snprintf(buf + bar_width, sizeof(buf) - bar_width,
@@ -502,7 +503,7 @@ void *sscp_monitor_thread(void *arg)
byte_du++)
done /= 1024;
- snprintf(suffix, sizeof(suffix), "%lu%s/%lu%s %.2f%s",
+ snprintf(suffix, sizeof(suffix), "%lu%s/%lu%s %.2f%s ",
done, byte_units[byte_du], total_round, byte_units[byte_tu],
bps, bps_units[bps_u]);
print_progress(percent, suffix);