From bf632684258421c329e572c647d06e76399bd258 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Janne=20Hyv=C3=A4rinen?= Date: Sun, 21 Apr 2013 14:02:48 +0300 Subject: [PATCH] Fix status print staying on the wrong line with certain filename length. Signed-off-by: Erik de Castro Lopo --- src/flac/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/flac/utils.c b/src/flac/utils.c index 03dbdc8..85a16f0 100644 --- a/src/flac/utils.c +++ b/src/flac/utils.c @@ -229,7 +229,7 @@ void stats_print_name(int level, const char *name) void stats_print_info(int level, const char *format, ...) { char tmp[80]; - int len, cleared_len; + int len, clear_len; if (flac__utils_verbosity_ >= level) { va_list args; @@ -240,10 +240,10 @@ void stats_print_info(int level, const char *format, ...) tmp[sizeof(tmp)-1] = '\0'; len = sizeof(tmp)-1; } - cleared_len = stats_char_count; stats_clear(); if (len >= console_chars_left) { - while (cleared_len > 0 && cleared_len--) fprintf(stderr, " "); + clear_len = console_chars_left; + while (clear_len > 0 && clear_len--) fprintf(stderr, " "); fprintf(stderr, "\n"); console_chars_left = console_width; } -- 2.7.4