summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl.c
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2017-01-16 07:56:53 +0100
committerGitHub <noreply@github.com>2017-01-16 07:56:53 +0100
commit8171bcc70f94a07fb59ba0a3bed2ca5c8af57bbb (patch)
tree73f089c6430a77b42553356fb2c260690dba18ae /src/systemctl/systemctl.c
parent74875a56cf5d7fd47190a78ec9fde71f72503ffe (diff)
parente0489532fd5969be6e261a558cae91005820fc0e (diff)
Merge pull request #5085 from keszybz/variables
Fixes for gcc and coverity warnings
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r--src/systemctl/systemctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 8955d5f51f..41e8d6075a 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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;
@@ -472,7 +472,8 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
id_len += incr;
desc_len += MIN(extra_len - incr, max_desc_len - desc_len);
}
- }
+ } else
+ desc_len = 0;
} else {
id_len = max_id_len;
desc_len = max_desc_len;