Fix thread state summary line display after r334918.

This commit is contained in:
markj 2018-07-10 17:20:27 +00:00
parent adf7f420a1
commit ca5deb61cb

View File

@ -347,12 +347,12 @@ i_procstates(int total, int *brkdn)
procstates_buffer = setup_buffer(procstates_buffer, 0);
/* write current number of processes and remember the value */
printf("%d %s:", total, (ps.thread) ? "threads" :"processes");
printf("%d %s:", total, ps.thread ? "threads" : "processes");
ltotal = total;
/* put out enough spaces to get to column 15 */
i = digits(total);
while (i++ < 4)
while (i++ < (ps.thread ? 6 : 4))
{
putchar(' ');
}
@ -389,10 +389,10 @@ else {
/* if number of digits differs, rewrite the label */
if (digits(total) != digits(ltotal))
{
fputs(" processes:", stdout);
printf(" %s:", ps.thread ? "threads" : "processes");
/* put out enough spaces to get to column 15 */
i = digits(total);
while (i++ < 4)
while (i++ < (ps.thread ? 6 : 4))
{
putchar(' ');
}