systemctl: fix alignment with units in not-found state
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 15 Jan 2017 18:38:43 +0000 (13:38 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 15 Jan 2017 18:38:43 +0000 (13:38 -0500)
A fixed value (6 and later 5) was added back in 4deb3b93911, and
not updated when load_len was added later on.

Also the other 5 with 1 + 1 + 1 + 1 + 1 to make it easier to see
that this is about the column separators.

src/systemctl/systemctl.c

index 9c0ee37..41e8d60 100644 (file)
@@ -450,7 +450,7 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
                 unsigned basic_len;
 
                 id_len = MIN(max_id_len, 25u); /* as much as it needs, but at most 25 for now */
-                basic_len = circle_len + 5 + id_len + 5 + active_len + sub_len;
+                basic_len = circle_len + 1 + id_len + 1 + load_len + 1 + active_len + 1 + sub_len + 1;
 
                 if (job_count)
                         basic_len += job_len + 1;