]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/cgroup-show: fix off-by-one in column counting
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 13 May 2019 22:05:32 +0000 (00:05 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 May 2019 08:57:23 +0000 (10:57 +0200)
We'd get one column too many, and the trailing ellipsis would end up in
the next row.

src/shared/cgroup-show.c

index 91a243944c78b9fa914abce1be4fec838c0f0399..cac7922ec0eb841b9fc3f413e5fbf404544035e7 100644 (file)
@@ -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;
         }