summaryrefslogtreecommitdiff
path: root/src/cgtop
diff options
context:
space:
mode:
authorUmut Tezduyar Lindskog <umut.tezduyar@axis.com>2015-03-11 11:24:18 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2015-03-11 16:59:53 +0100
commit510c4a0f1e7e7efe2897d2fbb9067f121467b103 (patch)
treec428ebb51826a3c36e1976a5a80c516f61155b05 /src/cgtop
parentf5b51ea7fcb0b6380c3ceb4d4f3f22f647c6fd32 (diff)
cgtop: fix assert when not on tty
systemd-cgtop --dept=1 -b -n 10 -d 0.1 | cat Assertion 'new_length >= 3' failed at src/shared/util.c:3 \ 595, function ellipsize_mem(). Aborting. Aborted (core dumped) (David: add comment)
Diffstat (limited to 'src/cgtop')
-rw-r--r--src/cgtop/cgtop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 3c7ad40605..f951c37cbc 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -447,7 +447,7 @@ static int display(Hashmap *a) {
Group *g;
Group **array;
signed path_columns;
- unsigned rows, n = 0, j, maxtcpu = 0, maxtpath = 0;
+ unsigned rows, n = 0, j, maxtcpu = 0, maxtpath = 3; /* 3 for ellipsize() to work properly */
char buffer[MAX3(21, FORMAT_BYTES_MAX, FORMAT_TIMESPAN_MAX)];
assert(a);