X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=eta.c;fp=eta.c;h=d019747b94587a1e951d253512044b52d954b8a1;hb=45d41a8b4a338404b838e6e5dcae376159d8dfb9;hp=c16b6cf9cdd4afd09da0ce206e3dc45e5804d34a;hpb=ab1ace6229f9f2e0b5e592b42f5cde4c29ff1a38;p=fio.git diff --git a/eta.c b/eta.c index c16b6cf9..d019747b 100644 --- a/eta.c +++ b/eta.c @@ -565,6 +565,7 @@ void display_thread_status(struct jobs_eta *je) size_t left; int l; int ddir; + int linelen; if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running || je->eta_sec == -1) @@ -606,9 +607,10 @@ void display_thread_status(struct jobs_eta *je) if (l >= left) l = left - 1; p += l; - if (l >= 0 && l < linelen_last) - p += sprintf(p, "%*s", linelen_last - l, ""); - linelen_last = l; + linelen = p - output; + if (l >= 0 && linelen < linelen_last) + p += sprintf(p, "%*s", linelen_last - linelen, ""); + linelen_last = linelen; for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) { free(rate_str[ddir]);