summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-08 18:57:26 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-08 18:57:43 +0100
commit6d6d40c910e14de8b09db58833dd1f1d95c03169 (patch)
tree1a34183b35f47f163bf2176743b36dc23a078ec9 /src/systemctl
parent0d95178e49eaf70fce9882d2a1277a9cd3555f34 (diff)
systemctl: properly initialize column widths for list-jobs
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 7e9b6eacf1..63800864ad 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1204,7 +1204,11 @@ static void output_jobs_list(const struct job_info* jobs, unsigned n) {
pager_open_if_enabled();
- id_len = unit_len = type_len = state_len = 0;
+ id_len = sizeof("JOB")-1;
+ unit_len = sizeof("UNIT")-1;
+ type_len = sizeof("TYPE")-1;
+ state_len = sizeof("STATE")-1;
+
for (j = jobs; j < jobs + n; j++) {
uint32_t id = j->id;
assert(j->name && j->type && j->state);