chiark / gitweb /
systemctl: properly initialize column widths for list-jobs
authorLennart Poettering <lennart@poettering.net>
Fri, 8 Nov 2013 17:57:26 +0000 (18:57 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 8 Nov 2013 17:57:43 +0000 (18:57 +0100)
src/systemctl/systemctl.c

index 7e9b6ea..6380086 100644 (file)
@@ -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);