From 83c743989f26ff4507d39525da5f99f5806f4995 Mon Sep 17 00:00:00 2001 From: "Stephen M. Cameron" Date: Mon, 4 Oct 2021 11:42:56 -0400 Subject: [PATCH] Remove dead store in progressbar_draw() Signed-off-by: Stephen M. Cameron --- lib/progressbar.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/progressbar.c b/lib/progressbar.c index 51d8880..9764dd2 100644 --- a/lib/progressbar.c +++ b/lib/progressbar.c @@ -173,11 +173,7 @@ static void progressbar_draw(const progressbar *bar) ? progressbar_calc_time_components(difftime(time(NULL), bar->start)) : progressbar_calc_time_components(progressbar_remaining_seconds(bar)); - if (label_width == 0) { - // The label would usually have a trailing space, but in the case that we don't print - // a label, the bar can use that space instead. - bar_width += 1; - } else { + if (label_width != 0) { // Draw the label fwrite(bar->label, 1, label_width, stderr); fputc(' ', stderr);