From: Jens Axboe Date: Tue, 17 Jun 2014 15:22:34 +0000 (-0600) Subject: Fixup run_str[] condensing with client/server X-Git-Tag: fio-2.1.11~60 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=6c784104cf90299aeec1d79f536a8e534c341c5f;p=fio.git Fixup run_str[] condensing with client/server Signed-off-by: Jens Axboe --- diff --git a/eta.c b/eta.c index 52c17282..0dd04be8 100644 --- a/eta.c +++ b/eta.c @@ -36,18 +36,16 @@ new: } else if (last == run_str[i]) { nr++; } else { - int elen; - - elen = sprintf(&run_str_condensed[ci], "(%u),", nr); - ci += elen; + ci += sprintf(&run_str_condensed[ci], "(%u),", nr); goto new; } } if (nr) - sprintf(&run_str_condensed[ci], "(%u)", nr); -} + ci += sprintf(&run_str_condensed[ci], "(%u)", nr); + run_str_condensed[ci + 1] = '\0'; +} /* * Sets the status of the 'td' in the printed status map. @@ -487,7 +485,8 @@ int calc_thread_status(struct jobs_eta *je, int force) return 0; je->nr_threads = thread_number; - memcpy(je->run_str, run_str, thread_number * sizeof(char)); + update_condensed_str(__run_str, run_str); + memcpy(je->run_str, run_str, strlen(run_str)); return 1; }