chiark / gitweb /
cgtop: fix assert when not on tty
[elogind.git] / src / cgtop / cgtop.c
index 3c7ad40605a0e8ac83e2692b83eeed4c527089dc..f951c37cbcb4299330bc6790b17651923a9b82cf 100644 (file)
@@ -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);