From: Zbigniew Jędrzejewski-Szmek Date: Mon, 13 May 2019 22:05:32 +0000 (+0200) Subject: shared/cgroup-show: fix off-by-one in column counting X-Git-Tag: v243-rc1~383^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=31c294dc4194f60fb5f8ae517e7f5d3caed69566;p=thirdparty%2Fsystemd.git shared/cgroup-show: fix off-by-one in column counting We'd get one column too many, and the trailing ellipsis would end up in the next row. --- diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c index 91a243944c7..cac7922ec0e 100644 --- a/src/shared/cgroup-show.c +++ b/src/shared/cgroup-show.c @@ -53,8 +53,8 @@ static void show_pid_array( if (flags & OUTPUT_FULL_WIDTH) n_columns = 0; else { - if (n_columns > pid_width+2) - n_columns -= pid_width+2; + if (n_columns > pid_width + 3) /* something like "├─1114784 " */ + n_columns -= pid_width + 3; else n_columns = 20; }